SQL to JSON Converter

Convert SQL INSERT statements to JSON, or switch modes to generate SQL from JSON.

Converted output will appear here...

Read a SQL Dump - or Build One - Without a Database

Database exports and API payloads speak two different languages: SQL and JSON. This tool switches between both directions in one place — parse SQL INSERT statements into readable JSON, or turn a JSON array into ready-to-run SQL, without needing a database running to test either direction.

Everything happens locally in your browser. Your SQL statements and JSON data are never uploaded anywhere.

Built for Real SQL Dumps and Real APIs

SQL → JSON correctly handles multi-row INSERT statements, quoted strings with commas or escaped quotes, NULL values, and multiple tables in one paste — the kind of formatting you get from mysqldump, pg_dump, or a database GUI's export feature. JSON → SQL infers sensible column types for an optional CREATE TABLE statement and supports MySQL, PostgreSQL, SQLite, and standard SQL identifier quoting.

Frequently Asked Questions

It parses INSERT INTO ... VALUES (...) statements — the most common way SQL dumps and database exports represent row data — including multi-row inserts and multiple tables in the same paste.

Yes. In SQL → JSON mode, choose 'JavaScript (const variable)' as the output format to get a ready-to-paste const declaration with unquoted object keys, instead of strict JSON.

Switch to the JSON → SQL tab, paste a JSON array of objects, set a table name and SQL dialect, then click Convert to SQL. You'll get one INSERT statement per row, or a single multi-row INSERT if that option is enabled.

Yes. Enable 'Include CREATE TABLE statement' in JSON → SQL mode and the tool infers a reasonable column type for each field from your data as a starting point.

MySQL, PostgreSQL, SQLite, and Standard SQL. Each formats identifiers correctly — backticks for MySQL, double quotes for PostgreSQL and SQLite — and adjusts how boolean values are written.

In SQL → JSON mode, if only one table is found the output is a plain JSON array. If multiple tables appear, the output becomes an object with each table name as a key and its rows as the value.

No. Both directions run entirely in your browser using JavaScript. Your SQL and JSON data never leave your device.