JSON to BigQuery Schema Converter — Numio
Generates a Google BigQuery table schema (a JSON array of name, type and mode fields) from sample JSON. Arrays become REPEATED, nested objects become RECORD, and all elements of an array are merged into one schema.
Drafting a schema file for bq load or bq mk --schema from a sample event or API response.
JSON
Big Query Schema
When to use it
- Drafting a schema file for bq load or bq mk --schema from a sample event or API response.
- Checking how nested objects and arrays in a log record map to RECORD and REPEATED columns before creating a table.
How to use
- Paste one JSON object or an array of sample records into the left editor, or use the load-file button to open a UTF-8 file.
- Read the schema on the right; check the type chosen for each field, especially dates, numeric strings and arrays.
- Copy the JSON array, adjust types or set mode to REQUIRED where needed, and save it as a schema file.
JSON sample object
{
"order_id": 1024,
"zip": "02139",
"coupon": null,
"created_at": "2026-01-05T10:00:00Z",
"items": [{ "sku": "A1", "qty": 2 }, { "sku": "B7", "price": 4.5 }]
}BigQuery schema JSON
[
{
"name": "order_id",
"type": "INTEGER",
"mode": "NULLABLE"
},
{
"name": "zip",
"type": "STRING",
"mode": "NULLABLE"
},
{
"name": "coupon",
"type": "STRING",
"mode": "NULLABLE"
},
{
"name": "created_at",
"type": "TIMESTAMP",
"mode": "NULLABLE"
},
{
"name": "items",
"type": "RECORD",
…Details and limitations
Strings are typed TIMESTAMP only when they look like an ISO date-time (2026-01-05T10:00:00Z) and DATE only for a bare YYYY-MM-DD; everything else, including numeric strings such as "02139", stays STRING.
A null value or empty array carries no type, so it becomes STRING (NULLABLE or REPEATED) unless another record supplies a value. Mode REQUIRED is never generated.
Fields are merged across all array elements: INTEGER with FLOAT becomes FLOAT, and other conflicting types fall back to STRING.
Conversion runs in your browser; nothing is uploaded.
FAQ
Why is my timestamp column typed TIMESTAMP and not DATETIME?
The generator does not distinguish zoned and local date-times; any ISO date-time string becomes TIMESTAMP. Change it to DATETIME by hand if the values have no time zone.
Can I paste an array of records?
Yes. A root array of objects is merged into one schema, so a field present in only some records is still included. NDJSON (one object per line) is not parsed; wrap the lines in [ ] with commas.
How are null values typed?
As NULLABLE STRING when no other sample gives the field a value, as coupon shows in the example. Supply a non-null sample, or edit the type, if the column is numeric or a RECORD.