About the SQL to JSON
Every row of INSERT INTO … VALUES (…), (…) becomes a JSON object. The keys come from the column list of the statement. When there is none, as in most mysqldump files, they come from the CREATE TABLE of that table earlier in the script, and without one the columns are named col1, col2… One table gives an array; several tables give an object with one array for each table name (the schema prefix is left out). Comments (--, /* */, #) and all other statements are skipped.
The dialects differ in how they quote, and the tool detects which one the script uses. Identifiers can be written as `name` (MySQL), "name" (standard SQL) or [name] (SQL Server). In strings, '' is always a quote; a backslash is an escape (\', \n) in MySQL only, and in PostgreSQL inside E'…'. N'…' strings, $$…$$ strings and casts such as '2026-01-15'::date are read as plain strings. Choose the dialect yourself when a string like 'C:\' is read wrongly.
Values: NULL becomes null, TRUE and FALSE booleans, numbers become JSON numbers, and integers too large for a JSON number stay strings so that no digit is lost. Hex literals (0x1F, X'1F') are kept as text or converted to numbers. Function calls and expressions such as NOW() cannot be evaluated without a database, so they are kept as strings. A row with the wrong number of values, an unclosed string or a missing parenthesis is reported with its line number.
How to use it
- Paste INSERT statements or open a .sql file.
- Check the detected dialect in the status, or choose it.
- Choose the shape of the output and the indentation.
- Copy the JSON or download data.json.