Developer tool / 21

SQL to JSON / JSON to SQL Converter

Convert JSON arrays into escaped SQL INSERT statements or parse SQL INSERT queries into JSON object arrays.

SQL to JSON / JSON to SQL Converter: TOEA converts JSON object arrays into SQL INSERT INTO queries with quote escaping, or extracts columns and values from SQL INSERT statements. Runs 100% locally in your browser with zero server file uploads.

Runs
In your browser
Cost
Free · no sign-up
Availability
Ready to use
SQL to JSON / JSON to SQL ConverterLocal processing

Runs entirely in your browser

What the INSERT reader expects

Statements may span several lines, and a multi-row VALUES (…), (…) from mysqldump gives one object per row. Commas, parentheses, and semicolons inside quoted strings are kept as text. Quoted values stay strings, so '02134' keeps its leading zero; only bare numerals become numbers, and bare TRUE, FALSE, and NULL become JSON's true, false, and null. A statement with no column list gets keys column_1, column_2, and so on. Other statements, such as CREATE TABLE, are skipped.

A function call such as NOW() is kept as its SQL text, not evaluated. For very large dumps, exporting straight to JSON or CSV from the database is faster and more exact.

Checking generated INSERT statements

The column list comes from the first object. Keys that appear only in later objects are dropped, and keys missing from a later object become NULL. Table and column names are written unquoted, so a column named order, user, or group fails as a reserved word; quote it with double quotes in PostgreSQL or backticks in MySQL. Nested objects are inserted as JSON text, which suits a json column. From a spreadsheet, CSV to SQL INSERT is the direct route.

How to use it

  1. Choose JSON to SQL or SQL to JSON mode.
  2. Paste JSON array or SQL INSERT statements.
  3. Click Convert to view, copy, or download the result.

Privacy & limitations

Parsing and conversion run entirely inside client memory.

Related tools

Frequently asked questions

Are single quotes escaped in SQL values?

Yes, single quotes within string values are safely escaped as double single-quotes ('').

Can I set a custom SQL table name?

Yes, you can customize the target SQL table name for INSERT queries.

Free tool · runs in your browser · no account required