JSON → SQL
Generate a CREATE TABLE statement from flat JSON rows.
Private by design. Your input never leaves this browser. Conversions run locally on your device.
What this tool handles
- Emits CREATE TABLE for PostgreSQL or SQLite from a flat object or an array of similar objects.
- Nested objects and arrays are stored as JSONB on PostgreSQL and TEXT on SQLite.
- Column types come from the sample; widths, indexes, constraints and foreign keys are not inferred.
- Identifiers are escaped for the selected dialect.
Example
JSON rows
[{"id":1,"name":"Ada","active":true}]
SQL
-- Generated by DevConvert from a JSON sample. Review before running.
-- Dialect: PostgreSQL
-- Supports a flat JSON object or an array of similar flat objects.
CREATE TABLE "my_table" (
"id" BIGINT NOT NULL PRIMARY KEY,
"name" TEXT NOT NULL,
"active" BOOLEAN NOT NULL
);
Related tools
- JSON → TypeScript — Generate TypeScript interfaces or types from a JSON sample.
- JSON → Zod — Generate a Zod schema from a JSON sample.
- JSON → Python — Generate Python dataclasses from a JSON sample.
- JSON → Go — Generate Go structs with json tags from a JSON sample.
- JSON → JSON Schema — Infer a JSON Schema from a sample document.
- Convert any format — Pick an input format and an output format and convert between any pair.