Output will appear here
Output will appear here
Convert JSON to SQL CREATE TABLE and INSERT INTO statements with this free online tool. The JSON to SQL generator infers column types, escapes string values, handles nulls, and produces database-ready SQL compatible with MySQL, PostgreSQL, and SQLite.
Try Convert All - paste JSON once, see TypeScript, Go, YAML, and 15 more formats instantly.
Enter a JSON array of objects where each object represents a table row. The converter uses the keys as column names and infers SQL data types from the values.
The output contains a CREATE TABLE statement with columns and data types followed by INSERT INTO statements for each object in the array. Column types are inferred as VARCHAR, INTEGER, FLOAT, BOOLEAN, or TEXT.
Copy the generated SQL or download it as a .sql file. Run it in MySQL, PostgreSQL, SQLite, or any SQL-compatible database to create and populate the table.
Paste a JSON array of objects into the converter. Each object becomes an INSERT INTO statement where keys map to column names and values map to properly quoted SQL values. The tool also generates the CREATE TABLE statement so you can run everything in one step.
Strings map to VARCHAR(255) or TEXT for long values, integers to INTEGER, decimals to FLOAT, booleans to BOOLEAN, null to nullable columns, and nested objects to TEXT columns containing the serialized JSON.
The generated SQL uses standard syntax compatible with MySQL, PostgreSQL, SQLite, and most SQL databases. Data type names follow ANSI SQL conventions. For database-specific types, you may want to adjust VARCHAR lengths or use JSONB in PostgreSQL.
Nested objects are serialized as JSON strings and stored in TEXT columns. If your database supports JSON columns (PostgreSQL JSONB, MySQL JSON), you can change the column type after generation to take advantage of native JSON querying.
Yes. The converter generates individual INSERT statements for each row, which works for small to medium datasets. For very large datasets, you can modify the output to use multi-row INSERT syntax or your database COPY/LOAD DATA command.