SQL to CSV
Paste INSERT statements or drop a .sql dump and get a CSV per table. Reads mysqldump, pg_dump and SQLite exports as text in your browser. No database to restore, no upload.
- Free, no sign-up
- REST + MCP
- Updated
- Reviewed by Olgun Ozoktas
The CSV will appear here..
Why Use Our SQL to CSV Converter?
A SQL dump is a text file of statements, not a database. That is the whole reason this page can exist: the rows are already sitting in the file as literal values, and reading them back out needs a parser, not a database engine.
The parser walks the file character by character, tracking whether it is inside a string, a quoted identifier or a comment. That detail matters more than it sounds. A regular expression that strips comments first will happily delete half a row whose text contains a double hyphen, and a splitter that breaks on every semicolon will cut a statement in two the moment a value contains one. Both failures are silent — you get a smaller CSV and no error.
Identifiers arrive in three styles depending on which database wrote the file: double quotes from PostgreSQL, backticks from MySQL, square brackets from SQL Server. All three are unwrapped. Dotted references keep only their last part, because public.users and users are the same table once the rows are in a spreadsheet.
What the page will not do is guess. An INSERT that draws its rows from a SELECT has no literal values in the file, so no honest parser can produce them; those statements are listed under the output by line number instead of being quietly dropped. Custom-format pg_dump archives, COPY BINARY sections and binary blobs are likewise out of scope — they are not text, and pretending otherwise would produce a plausible, wrong CSV.
How it compares
Most online SQL to CSV tools upload your dump to a server to do the work. A database export is usually the most sensitive file anybody will hand you — customer records, email addresses, order history — so uploading it to convert it is a poor trade. This page runs the parser in your browser; the file never leaves the tab.
Some converters take a different route and run the SQL against an in-browser SQLite engine, which means your dump has to be valid SQLite and has to include a CREATE TABLE and a trailing SELECT. A plain mysqldump full of INSERT statements will not load. Reading the statements as text has no such requirement.
If you already have a .db or .sqlite file rather than a dump, the SQLite Browser opens it directly and exports CSV from there. Going the other way, CSV to SQL turns a spreadsheet back into INSERT statements.
SQL to CSV Tips
- Column names come from the INSERT column list first, then from a CREATE TABLE earlier in the same file, then from positions — so include the CREATE TABLE if you have it.
- NULL becomes an empty cell, never the word null, so a spreadsheet reads it as blank rather than text.
- Both escaping styles are handled: the standard doubled quote and MySQL's backslash escapes.
- A dump with several tables gives you a zip. Downloading one table alone still works from the picker.
- An INSERT ... SELECT carries no literal rows. It is listed under the output rather than guessed at.