SQL INSERT to JSON Converter

Paste one or more SQL INSERT statements, get back a JSON array of objects with one entry per row. The inverse of CSV-to-SQL: useful when you have a legacy SQL dump and want to migrate the data into a NoSQL store, a flat file, or a different schema. Handles MySQL backticks, Postgres double quotes, batch inserts, and standard escaping.

How to use the SQL INSERT to JSON Converter

Paste your INSERT statements. The parser walks each statement, extracts the column list, splits the values list into tuples, and builds one JSON object per row using the columns as keys. Multiple statements in one input are combined into the same output array — useful for dumps that have many tables’ worth of inserts.

Coerce mode converts string literals that look like numbers ('42') or booleans ('true') to their typed equivalents in JSON. Turn off to preserve exact source representation.

About SQL INSERT to JSON Converter

SQL dumps are how databases historically share data: portable, human-readable, schema-aware. But when you’re migrating to a different system (a document database, a search index, a data lake), the SQL is in the way — you want the underlying rows as structured data you can feed to the new system’s ingest API. Tools like mysqldump --tab can produce CSV, but that requires shell access to the source DB; if all you have is a .sql file someone emailed you, you need to parse it.

This parser handles the common dialects. MySQL uses backticks for identifier quoting and backslash for escapes; PostgreSQL and SQLite use double-quotes for identifiers and doubled single-quotes for string escapes. Batch statements (multi-row tuples) split correctly. Comments (-- and /* */) are stripped before parsing. The output’s a clean JSON array ready for jq, MongoDB import, Elasticsearch bulk, or any other downstream tool.

Common use cases

  • Migrating SQL → MongoDB / Firestore — turn INSERTs into documents.
  • Importing legacy data into a data lake — emit JSONL for S3 / GCS.
  • Schema analysis — see the actual data without a SQL client.
  • Cross-database migration — parse source INSERTs, re-emit in target dialect via our CSV to SQL tool.

Frequently asked questions

Does it execute the SQL?

No \xE2\x80\x94 it parses INSERT syntax to extract values. No database is touched, no statements run. Safe to paste even DDL-laden dumps.

What about INSERTs without column lists?

Columns are required to label the values. If your statement omits the column list, add one manually first \xE2\x80\x94 the parser needs the column names to label each JSON property.

Will it handle a 100MB dump?

Up to ~10MB comfortably in a browser. For larger dumps, use a stream parser (sql-parser CLI, or write a quick Python script).