SQL to JSON Converter
Paste SQL INSERT statements and get a JSON array of row objects. Column names become keys, NULL becomes null, numbers and booleans are decoded, and quoted strings are unescaped. Your SQL stays in your browser.
How to convert SQL to JSON
- Paste one or more SQL INSERT statements, with or without a column list.
- Pick pretty or compact output, and enable MySQL backslash escapes if your dump uses them.
- Copy the JSON or download it as a .json file.
Examples
Insert with a column list
INSERT INTO users (id, name) VALUES (1, 'Ada'), (2, 'Linus');
[
{ "id": 1, "name": "Ada" },
{ "id": 2, "name": "Linus" }
]NULL and quoted text
INSERT INTO t (email, note) VALUES (NULL, 'O''Brien');
[
{ "email": null, "note": "O'Brien" }
]Frequently asked questions
Is my data uploaded anywhere?
No. The conversion runs entirely in your browser, so your SQL never leaves your device.
What if my inserts have no column list?
When a statement has no column list, the values are keyed col1, col2, col3 and so on, one per value in the tuple.
How are types handled?
Plain numbers become JSON numbers, NULL becomes null, and TRUE and FALSE become booleans. Quoted text becomes a JSON string with doubled quotes ('') unescaped. Very large integers are kept as strings so their precision is not lost.
Which SQL dialects does it accept?
It reads standard INSERT statements from PostgreSQL, MySQL, SQLite and SQL Server, including double-quoted, backtick and bracketed identifiers, comments, and multiple value tuples per statement.
What about backslash escapes like \n?
By default backslashes are kept literal, which is correct for standard SQL and for data such as Windows paths. If your dump uses MySQL backslash escaping, turn on the backslash escapes option to decode \n, \t and \' inside strings.
Does it handle multiple statements at once?
Yes. Paste any number of INSERT statements and every row is collected into a single JSON array. Non-INSERT statements such as CREATE TABLE or SELECT are ignored.
Learn more
- SQL to JSON examples
Common INSERT shapes and the JSON they produce, including NULLs, multiple rows and quoted identifiers.
Related tools
JSON to SQL
Convert JSON to SQL INSERT statements online. Paste an array of objects, set a table name, and get ready-to-run INSERTs. Runs in your browser.
CSV to JSON
Convert CSV to JSON online. Turn spreadsheet rows into clean JSON objects or arrays, with smart number and boolean typing. Free tier plus API.
SQL Formatter
Format and beautify SQL online. Put clauses on their own lines, indent the column list and uppercase keywords. Fast and runs in your browser.
JSON Formatter
Format, validate and minify JSON online. Pretty-print with custom indentation, sort keys and catch syntax errors. Runs in your browser.
Air Fryer Converter
Convert any conventional oven recipe to air fryer settings. Lower the temperature by 25 F and cut the cook time by about 20 percent automatically.
Baker's Percentage Calculator
Turn a bread formula into grams with baker's percentages. Flour is 100 percent, enter water, salt and yeast percents to get weights and hydration.