PlayWithJSON

JSON to BigQuery Schema Generator

BigQuery / GCP

Generate Google BigQuery table schema JSON and CREATE TABLE DDL from any JSON or JSON5 payload in your browser.

Samples:
Format:
Indent:
JSON / JSON5 InputJSON
19 lines | 409 charsJSON
BigQuery OutputBQ
[
  {
    "name": "status",
    "type": "STRING",
    "mode": "REQUIRED"
  },
  {
    "name": "statusCode",
    "type": "INT64",
    "mode": "REQUIRED"
  },
  {
    "name": "data",
    "type": "RECORD",
    "mode": "REQUIRED",
    "fields": [
      {
        "name": "userId",
        "type": "STRING",
        "mode": "REQUIRED"
      },
      {
        "name": "username",
        "type": "STRING",
        "mode": "REQUIRED"
      },
      {
        "name": "email",
        "type": "STRING",
        "mode": "REQUIRED"
      },
      {
        "name": "profile",
        "type": "RECORD",
        "mode": "REQUIRED",
        "fields": [
          {
            "name": "firstName",
            "type": "STRING",
            "mode": "REQUIRED"
          },
          {
            "name": "lastName",
            "type": "STRING",
            "mode": "REQUIRED"
          },
          {
            "name": "skills",
            "type": "STRING",
            "mode": "REPEATED"
          }
        ]
      },
      {
        "name": "preferences",
        "type": "RECORD",
        "mode": "REQUIRED",
        "fields": [
          {
            "name": "theme",
            "type": "STRING",
            "mode": "REQUIRED"
          },
          {
            "name": "notifications",
            "type": "BOOL",
            "mode": "REQUIRED"
          }
        ]
      }
    ]
  },
  {
    "name": "timestamp",
    "type": "TIMESTAMP",
    "mode": "REQUIRED"
  }
]
78 lines | 1471 charsBQ

JSON to BigQuery Schema & SQL Generator Online

Convert JSON payloads or arrays of JSON records directly into Google BigQuery Table Schema (JSON array) or standard BigQuery SQL DDL (CREATE OR REPLACE TABLE).

Supports nested RECORD (STRUCT) types, REPEATED arrays, smart ISO-8601 TIMESTAMP/DATE detection, and custom partitioning clauses. Everything runs completely in your browser without uploading your sensitive data.

{}

Why Use PlayWithJSON?

  • Generate native BigQuery Table Schema JSON for bq load and Terraform
  • Generate standard BigQuery SQL CREATE OR REPLACE TABLE DDL
  • Automatic detection of RECORD (STRUCT) and REPEATED arrays
  • Intelligent ISO timestamp and date parsing
  • 100% private, client-side execution with no data transmission

Key Features of BigQuery Schema Generator

Dual Output Modes

Switch seamlessly between BigQuery Schema JSON format and BigQuery SQL CREATE TABLE DDL.

RECORD & Struct Support

Deep nested objects are automatically mapped to RECORD fields in JSON or STRUCT<...> in SQL.

REPEATED Array Detection

Arrays of primitives or nested objects are converted to REPEATED modes and ARRAY<...> types.

Smart Date & Timestamp Inference

Detects ISO-8601 formatted strings and maps them to TIMESTAMP or DATE instead of plain STRING.

Partitioning & Clustering

Specify PARTITION BY clauses directly in the generator options to produce production-ready DDL.

One-Click Export

Copy to clipboard or download the generated schema file ready for bq cli or Google Cloud Console.

How to Convert JSON to BigQuery Schema

1

Paste Your JSON

Paste a JSON object, array of rows, or sample API response into the editor.

2

Select Output Format

Choose Schema (JSON) for bq load / Terraform or SQL for BigQuery Studio.

3

Customize Options

Optionally set your dataset.table name and date detection preferences.

4

Copy or Download

Copy the result or download schema.json / schema.sql for immediate use.

JSON to BigQuery Schema Example

JSON (Input)
{ "id": 101, "username": "shyam_dev", "active": true, "tags": ["cloud", "data"], "metadata": { "role": "admin", "score": 98.5 }, "created_at": "2026-10-30T10:00:00Z" }
BigQuery Schema (JSON Output)
1[
2 { "name": "id", "type": "INT64", "mode": "REQUIRED" },
3 { "name": "username", "type": "STRING", "mode": "REQUIRED" },
4 { "name": "active", "type": "BOOL", "mode": "REQUIRED" },
5 { "name": "tags", "type": "STRING", "mode": "REPEATED" },
6 {
7 "name": "metadata",
8 "type": "RECORD",
9 "mode": "REQUIRED",
10 "fields": [
11 { "name": "role", "type": "STRING", "mode": "REQUIRED" },
12 { "name": "score", "type": "FLOAT64", "mode": "REQUIRED" }
13 ]
14 },
15 { "name": "created_at", "type": "TIMESTAMP", "mode": "REQUIRED" }
16]

Schema Validation Rules

Unsupported JSON Structure
1[
2 "raw string array without keys"
3]
BigQuery schemas require key-value object structures or lists of objects.
Valid BigQuery Table Row
1[
2 { "event_id": "evt_1", "duration_sec": 12.4 }
3]

Supported BigQuery Data Types

INT64 and FLOAT64 number mapping
STRING and BOOL data types
TIMESTAMP, DATE, and TIME string detection
RECORD (STRUCT) nested field hierarchy
REPEATED (ARRAY) repeated modes
BigQuery Schema JSON export
BigQuery SQL CREATE OR REPLACE TABLE DDL
PARTITION BY custom clause support
Safe identifier sanitization
100% in-browser offline execution
Frequently Asked Questions

Frequently Asked Questions about BigQuery Schema Generation

Save the output as schema.json and run: `bq load --source_format=NEWLINE_DELIMITED_JSON my_dataset.my_table gs://my-bucket/data.json ./schema.json`.

More JSON Developer Tools

View All Tools

JSON Formatter

Format, validate and inspect JSON data

JSON5 Formatter

Format and validate JSON5 with comments

JSON ↔ JSON5

Convert between JSON and modern JSON5

JSON to TypeScript

Generate TypeScript interfaces from JSON

JSON to Zod

Generate Zod schemas from JSON

Text to JSON

Convert text and schemas into structured JSON

JSON Sorter Online

Sort JSON keys alphabetically and order arrays

JWT Decoder Online

Decode JWT header, payload and expiration

JSON Stringify Online

Escape quotes and stringify or unescape JSON

Mock JSON Generator

Generate realistic mock data for APIs and testing

JSON to CSV

Export structured JSON arrays into CSV spreadsheets

JSONPath Tester

Query and filter JSON data with path expressions

JSON Schema Generator

Generate JSON Schema from sample JSON

JSON Diff & Compare

Compare two JSON objects and find differences

JSON ↔ YAML

Convert JSON/JSON5 to YAML and back with comments

JSON ↔ XML

Convert JSON to XML and XML to JSON with attributes

YAML to CSV

Convert YAML lists and objects into spreadsheets

CSV to JSON / JSON5

Convert CSV/TSV to JSON or JSON5 with type parsing

JSON to BigQuery

Generate BigQuery Schema JSON and CREATE TABLE DDL

JSON to GraphQL

Generate GraphQL SDL types, queries, and inputs

JSON to MySQL

Generate MySQL CREATE TABLE DDL and INSERT queries

JSON to PostgreSQL

Generate PostgreSQL CREATE TABLE DDL, JSONB and INSERTs

JSON Flattener

Flatten nested JSON to dot notation or unflatten back

JSON Tree Visualizer

Interactive SVG mindmap graph and collapsible node tree

JSON Minifier Online

Compact and compress JSON by stripping whitespace

JSON Token Counter

Calculate LLM tokens (GPT-4o, Claude) and API costs

Broken JSON Repair

Automatically heal broken and truncated AI/LLM JSON