SQL to JSON Converter
Paste one or more SQL INSERT statements and get back the rows as a JSON array — with column names as keys and proper type detection for strings, numbers, NULL, and booleans.
Last updated: May 27, 2026
Find this tool useful? Support the project to keep it free!
Buy me a coffeeWhat is SQL to JSON Converter?
Database fixtures and export files often live as raw `INSERT INTO` statements — but downstream tools usually want JSON. Manually converting a multi-row insert is tedious and error-prone, especially with escaped strings and NULL values mixed in.
This converter parses INSERT statements like a real SQL tokenizer: it understands the three identifier-quoting styles (backticks for MySQL, double quotes for PostgreSQL, brackets for SQL Server), single- and double-quoted strings with both backslash and doubled-quote escaping, comments, and the NULL/TRUE/FALSE keywords. The result is a clean JSON array, one object per row, with the column names from the `INSERT INTO ... (...)` clause as keys.
How to Use SQL to JSON Converter
Paste one or more SQL INSERT statements.
Toggle pretty printing and indent.
Optionally wrap the output as { tableName: [...] } if you want to preserve the table name.
Copy the JSON output.
Common Use Cases
- Converting a database dump (.sql) into JSON fixtures for a test suite.
- Extracting tabular data from a SQL export for use in a JavaScript app.
- Migrating from a SQL-based fixture format to a JSON one.
- Debugging an INSERT by viewing the rows as parsed JSON.
Example Input and Output
A multi-row INSERT becomes a JSON array of objects.
INSERT INTO users (id, name, active) VALUES (1, 'Alice', TRUE), (2, 'Bob', FALSE);[
{ "id": 1, "name": "Alice", "active": true },
{ "id": 2, "name": "Bob", "active": false }
]Privacy
All parsing happens in your browser. No SQL is sent to a server.
Number precision
Numbers larger than 2^53 lose precision in JavaScript. For BIGINT values, wrap them in quotes in the SQL (or post-process) to keep them as strings.

