SQL INSERT to CSV / JSON Converter
Paste INSERT statements from mysqldump, pg_dump --inserts, SSMS or any SQL export and get clean CSV, TSV, JSON or a Markdown table back. A real SQL scanner reads the VALUES lists, so quoted strings containing commas, semicolons, parentheses or newlines, '' and backslash escapes, NULL, negative and exponent numbers, hex literals and expressions like NOW() or CAST(... AS ...) all come out right. CREATE TABLE, LOCK TABLES and SET lines are skipped, and each table in the dump gets its own output. Nothing is uploaded: the conversion runs entirely in your browser.
Do more than sql insert to csv / json converter — meet Chat2DB
Chat2DB is an AI-powered SQL client for Windows, macOS and Linux. Write SQL in natural language, format and optimize queries automatically, and manage MySQL, PostgreSQL, Oracle and 20+ other databases in one workspace.
How to use
- Paste one or more INSERT INTO ... VALUES statements, or a whole mysqldump / pg_dump --inserts file. Turn off Backslash escapes for PostgreSQL or SQL Server scripts.
- Pick the output format (CSV, TSV, JSON or Markdown) and adjust the delimiter, header row, NULL representation and line ending.
- Choose a table if the script contains several, then copy the result or download it as a .csv, .tsv, .json or .md file.
Frequently asked questions
How do I convert a mysqldump file to CSV?
Paste the dump (or the part with the tables you need). The converter ignores comments, /*!40101 SET ... */ lines, DROP/CREATE TABLE and LOCK TABLES, reads every INSERT INTO ... VALUES row with MySQL backslash escapes, and gives each table its own CSV you can copy or download. For pg_dump --inserts output, switch Backslash escapes off, since PostgreSQL standard strings treat a backslash as a normal character.
How are NULL, empty strings and the text 'NULL' kept apart?
An unquoted NULL is written with the NULL representation you choose (empty, NULL or \N). If a real string equals that representation, for example the text 'NULL' or an empty string '', it is wrapped in double quotes so importers such as PostgreSQL COPY ... CSV can tell them apart. In JSON, NULL becomes null, numbers stay numbers and TRUE/FALSE become booleans.
Can I export query results straight to CSV instead of converting INSERT statements?
Yes. If you still have access to the database, it is easier to run the query and export the result grid directly. Chat2DB (https://chat2db.ai/download, or the web version at https://app.chat2db.ai) exports any result set or table to CSV, Excel, JSON or SQL INSERT statements for MySQL, PostgreSQL, SQL Server, Oracle and 20+ other databases.
