utilitech

SQL to JSON

Turn SQL INSERT statements into JSON or CSV, or JSON back into INSERT statements for MySQL, PostgreSQL and SQL Server.

SQL (INSERT statements)

1 INSERT statement · 1 table · 3 rows

JSON

26 lines · 493 bytes
SQL → JSON
  • Paste INSERT statements — from a mysqldump, pg_dump (with --inserts) or SQL Server script — and get a JSON array of rows, or download them as CSV.
  • Column names come from the INSERT's column list, or from a CREATE TABLE earlier in the script. Several tables become one JSON object keyed by table name.
  • NULL becomes null, TRUE/FALSE become booleans and numbers stay numbers (except very long ones, kept as text so no digits are lost). Functions like NOW() are kept as text.
JSON → SQL
  • Paste an array of objects to get INSERT statements. Every key becomes a column; missing values become NULL, and nested objects or arrays are stored as JSON text.
  • Quotes and special characters are escaped the right way for the database you pick. SQL Server allows at most 1000 rows per INSERT.
  • Everything runs in your browser — your data is never uploaded.