JSON to BigQuery Schema Converter — Free Online Tool
Convert JSON to a Google BigQuery schema definition using AI. Generates typed field definitions with NULLABLE modes instantly. Free, no sign-up.
JSON to BigQuery Schema Converter — Free Online Tool
About JSON to BigQuery Schema Converter — Free Online Tool
This tool converts a JSON object into a Google BigQuery schema definition — the array of field objects that BigQuery's API and bq load command accept. Each JSON key becomes a BigQuery field with an inferred type and NULLABLE mode.
JSON to BigQuery Field Type Mapping
| JSON type | BigQuery type | Notes |
|---|---|---|
| string | STRING | Default for all text values |
| integer (whole number) | INTEGER | Maps to INT64 in standard SQL |
| float / decimal | FLOAT | Maps to FLOAT64 in standard SQL |
| boolean | BOOLEAN | true/false → BOOL |
| null | STRING (NULLABLE) | Inferred as STRING when value is null |
| object | RECORD (STRUCT) | Nested fields become a RECORD type |
| array of objects | RECORD REPEATED | mode: REPEATED with nested fields |
| array of primitives | STRING/INTEGER REPEATED | mode: REPEATED, type from element |
BigQuery Schema Field Modes
| Mode | Meaning | When to use |
|---|---|---|
| NULLABLE | Field may be null | Default — most API response fields |
| REQUIRED | Field must have a value | Primary keys, mandatory fields |
| REPEATED | Array of values | JSON arrays |
Frequently Asked Questions
How do I load JSON to BigQuery?
Use bq load --source_format=NEWLINE_DELIMITED_JSON with the generated schema file, or pass the schema inline via the BigQuery API. Each JSON line in your file becomes one row. Use this tool to generate the schema from a sample JSON record.
What is NEWLINE_DELIMITED_JSON (NDJSON) in BigQuery?
BigQuery expects each JSON record on its own line — one JSON object per line, no wrapping array. This format is called NDJSON or JSONL. If your source is a single JSON array, you need to convert it to one-object-per-line before loading.
How do I handle nested JSON objects in BigQuery?
Nested objects map to RECORD (STRUCT) type with nested fields. BigQuery supports up to 15 levels of nesting. This tool generates the correct nested field structure from your JSON automatically.
What does mode: NULLABLE mean in BigQuery?
NULLABLE means the field can contain a null value. This is the default mode for all generated fields. Change a field to REQUIRED only when you are certain it will never be null in your data.
Can I use this schema with the BigQuery REST API?
Yes. The generated JSON array is exactly the format expected by the BigQuery tables.insert API's schema.fields property and the bq load --schema flag.
If jsondecode.com saved you time, share it with your team
Free forever. No ads. No sign-up. Help other developers find it.