JSON To BigQuery Schema
Generate BigQuery table schemas from sample JSON data with real-time browser-side conversion for data pipeline setup.
Generate BigQuery table schemas from JSON
BigQuery tables are defined by field names, data types, and modes such as
NULLABLE or REPEATED. When you have sample JSON payloads from an
API, log stream, or ETL job, inferring a schema by hand is slow and error-prone. This tool
inspects your JSON object and outputs a BigQuery-compatible field list you can paste into load
jobs, Terraform, or the BigQuery console.
What this tool does
Paste a JSON object in the input panel. The generator walks each key, maps JavaScript values
to BigQuery types, and nests RECORD fields for objects and arrays. The output
is a JSON array of field definitions with name, type,
mode, and nested fields where needed.
Type mapping rules
- Strings become
STRING, with date and timestamp detection for common formats. - Integers map to
INTEGERand floating-point numbers toFLOAT. - Booleans map to
BOOLEAN. - Nested objects become
RECORDfields with child field definitions. - Arrays become
REPEATEDfields based on the first element type.
Common use cases
- Prototype BigQuery tables before loading JSON exports from APIs.
- Document expected payload shapes for analytics pipelines.
- Generate starter schemas for Cloud Functions or Dataflow ingestion jobs.
- Compare inferred schemas against production table definitions during migrations.
Related tools
Build a JSON Schema from sample data with the JSON to JSON Schema Generator, convert JSON to YAML with the JSON to YAML Converter, or format and validate JSON using the JSON Formatter.
Frequently Asked Questions
Does the input need to be a JSON object?
Yes. The root value must be a JSON object because BigQuery table schemas describe named top-level fields. Arrays and primitive values at the root are not supported.
How are arrays handled?
JSON arrays are emitted as REPEATED fields. The tool inspects the first
array element to determine the repeated field type. Empty arrays default to a
nullable repeated field.
Can I use this output directly in BigQuery?
The generated JSON follows BigQuery field schema structure and can be used as a starting point for table creation or load job configuration. Review inferred types against your full dataset because a single sample may not represent every edge case.
What if my JSON contains mixed types in one field?
BigQuery columns have a single type. The tool infers types from the sample value you provide. If production data mixes types in the same field, coerce or normalize values before loading or choose a broader type manually.
Is my JSON uploaded to a server?
No. Schema inference runs entirely in your browser. Your JSON content is not stored or transmitted to our servers.