ToolZoneX
Blog

JSON to BigQuery Schema Converter

Paste a JSON sample to instantly generate a matching Google BigQuery table schema, with nested RECORD fields and REPEATED/NULLABLE/REQUIRED modes inferred automatically. Free online developer tool.

Paste JSON
BigQuery Schema
BigQuery table schema JSON will appear here...

Free JSON to BigQuery Schema Converter

Paste a JSON sample to instantly generate a matching Google BigQuery table schema, in the JSON array format BigQuery's load jobs and client libraries expect. Nested objects become RECORDfields with a nested fields array, and arrays get the REPEATED mode.

How to Use It

Paste any JSON object into the input box, or click "Load Example" to see a sample run. The converter parses your JSON, maps each field to a BigQuery type and mode, and generates a[{ "name": ..., "type": ..., "mode": ... }] array you can pass directly tobq load --schema or the BigQuery client libraries.

Example

Given {"name": "Ann", "age": 30, "tags": ["a","b"], "address": {"city": "NYC", "zip": null}}, the tool generates a name field of type STRING with modeREQUIRED, an age field of type INTEGER, a tagsfield of type STRING with mode REPEATED, and an address field of type RECORD with mode NULLABLE containing nested city andzip fields.

Common Use Cases

  • Preparing a schema file for a bq load job from a sample JSON export.
  • Bootstrapping a BigQuery table definition for a new data pipeline destination.
  • Checking at a glance how nested JSON will map to BigQuery's RECORD/REPEATED model.
  • Speeding up ETL development by generating a first-draft schema from real sample rows.

FAQs

How is the REPEATED mode chosen?

Any field backed by a JSON array is given BigQuery's REPEATED mode, since BigQuery's field mode is mutually exclusive — a repeated field can't also be marked NULLABLE orREQUIRED. Object and scalar fields get NULLABLE if they were ever missing or null, and REQUIRED otherwise.

How are nested objects represented?

A nested object becomes a field with "type": "RECORD" and a nested"fields" array describing its own properties, matching BigQuery's native representation of struct-like columns.

Is my JSON uploaded anywhere?

No — parsing and schema generation happen entirely client-side in your browser. Nothing you paste is sent to a server.