Convert SQL to JSON Online | Free & Secure
Convert SQL INSERT statements to JSON online. Supports multiple statements, standard SQL syntax, and file uploads, with secure client-side conversion.
Paste SQL INSERT statements and this tool converts each row into a JSON object, collecting every row into one array keyed by column name. Table and column names may be bare, "double-quoted", or `backticked`, and statements without a column list get keys col_1, col_2, and so on. NULL becomes null, unquoted numbers become JSON numbers, and everything else stays a string. It all runs in your browser, so your data stays on your device.
You May Also Need
How to Convert SQL to JSON
- 1
Paste or upload your SQL
Enter one or more INSERT INTO statements, or upload a .sql file; anything that is not an INSERT, such as CREATE TABLE, is skipped.
- 2
Click "Convert to JSON"
The parser reads the column list and each VALUES tuple, ignoring commas, parentheses, and semicolons that appear inside quoted strings.
- 3
Review the JSON array
Every row from every statement appears as an object in one array, in the same order as in your input.
- 4
Copy or download
Use Copy to send the JSON to your clipboard, or Download to save it as a .json file.
References
- MySQL Reference Manual
The official MySQL documentation covering INSERT statement syntax, data types, and SQL standards the parser follows.
- RFC 8259 — JSON
The IETF specification for the JSON data interchange format produced by this converter.
Related Tools
MySQL to JSON
Convert MySQL dump and INSERT statements into JSON, tuned for MySQL syntax.
JSON Formatter
Beautify, validate, and minify the JSON output from your converted SQL.
JSON to CSV
Turn your JSON array of rows back into spreadsheet-ready CSV.
CSV to JSON
Convert tabular CSV data into structured JSON arrays.
Frequently Asked Questions
- Which SQL dialects work?
- Plain INSERT INTO table (columns) VALUES (...) statements from PostgreSQL, SQLite, MySQL, and similar databases. Strings are unescaped MySQL-style, so \' becomes a quote, while the standard doubled quote in 'O''Brien' is kept as written.
- What happens to TRUE, FALSE, and dates?
- They stay strings. Only NULL and unquoted numbers are converted, so TRUE becomes "TRUE" and '2024-01-31' stays a date string you can parse in your own code.
- What if my INSERT has no column list?
- Each value is keyed by its position—col_1, col_2, col_3—because there are no names to use. Add the column list to the statement to get named keys.
- Can I convert multiple INSERT statements at once?
- Yes. Paste any number of INSERT statements, including multi-row VALUES lists, and all rows are combined into a single JSON array.
- Can I upload a .sql file instead of pasting?
- Yes. Use the Upload SQL button to load a .sql file directly, then run the conversion just as you would with pasted text.
- Is my SQL data sent to a server?
- No. All parsing runs entirely in your browser, so your SQL and the resulting JSON never leave your device.