Convert MySQL to JSON
Dumps, query output
or an export query.
Paste mysqldump INSERT statements or the output of the mysql client and get a JSON array with the right types — or generate a JSON_ARRAYAGG query so MySQL exports the JSON itself. Runs entirely in your browser — your data never leaves your device.
Three ways to export MySQL to JSON
Pick the one that matches what you already have.
From a dump file
Open the .sql file produced by mysqldump, phpMyAdmin or Adminer and paste the INSERT statements. Column names come from the INSERT or from the CREATE TABLE block; several tables become one JSON object keyed by table name.
From the mysql client
Run mysql -B -e "SELECT * FROM users" mydb and paste the tab-separated output, or paste the boxed table printed in an interactive session. \N and NULL become null.
Let MySQL build the JSON
On MySQL 5.7.22+ and 8.0, JSON_ARRAYAGG(JSON_OBJECT(...)) returns the whole table as one JSON array. Choose "Generate a JSON export query" and paste your CREATE TABLE to get it ready to run.
Types are never changed silently
Quoted values stay strings, so '01234' keeps its leading zero. 1 and 0 stay numbers (TINYINT flags are not turned into booleans), NULL becomes null, MySQL backslash escapes such as \' and \n are decoded, and BIGINT values above 253 are written as exact numbers instead of being rounded. Semicolons and parentheses inside strings never cut a statement.
