.sql.csv

SQL to CSV Converter

Pull rows out of SQL INSERT statements and lay them out as CSV. Runs 100% in your browser — nothing you upload here ever touches a server.

Input

Drop a file here or click to upload or paste content directly into the box below

Output

Why convert SQL to CSV

Database dumps and migration scripts are often shared as raw SQL files full of INSERT INTO statements, which is great for restoring a database but useless for a quick look at the actual data, or for handing to a colleague who just wants to open it in a spreadsheet. This tool reads those INSERT statements and lays their values out as a proper CSV table.

How the parser reads INSERT statements

The tool scans your SQL text for INSERT INTO table (columns) VALUES (...), (...); patterns using careful text parsing that respects quoted string values, so commas and parentheses inside a quoted string like an address or product description don't get mistaken for value separators. Multiple statements inserting into the same table are combined into one continuous set of rows in the output.

Where column names come from

When your SQL explicitly lists column names in parentheses after the table name, those become the CSV header row directly. If your INSERT statements only specify values without listing columns, an increasingly common shorthand in some generated dumps, the tool falls back to generic column labels like col1, col2, so the data is still usable, just without the original field names attached.

Typical use cases

Developers use this to quickly inspect the actual data inside a SQL dump file without spinning up a database to run the script. Analysts use it to pull a specific table's data out of a larger migration file and get it into a spreadsheet for a one-off report, without needing direct database access. It's also handy for extracting sample data from a SQL seed file for a quick manual review.

Limitations to be aware of

This tool parses INSERT statement syntax directly rather than executing SQL, so it won't evaluate functions, expressions, or subqueries used as values, those will appear as literal text in the CSV rather than their computed result. It also focuses on standard INSERT INTO ... VALUES syntax; other statement types like UPDATE or dialect-specific bulk-insert commands aren't parsed.

Step-by-step walkthrough

Paste your SQL dump or script into the input box, or drop a .sql file onto the page to load it automatically. Click Convert, and the parser scans for INSERT INTO ... VALUES statements, combining every matching row it finds into one table, then reports how many rows it extracted and which table they came from. Once the CSV in the output box looks correct, click Download Result to save converted.csv.

Privacy and performance

Because the sql to csv converter runs as JavaScript inside your own browser tab rather than on a remote server, there's no upload step, no waiting on a network connection, and no copy of your file sitting on someone else's infrastructure afterward. That also means it keeps working exactly the same whether your file is a few bytes or several megabytes, limited only by your own device's memory rather than a server's queue or rate limit. If you ever want to double-check that nothing is being transmitted, your browser's built-in developer tools network tab will show no outgoing request for the file's contents at any point during conversion. This also means the tool keeps working offline once the page has loaded, and closing the tab afterward leaves no copy behind on any server, since one was never made in the first place. That's a meaningful difference from typical online converters, which usually require uploading your file to a remote service before you ever see a result.

Frequently Asked Questions

Does it work with multiple INSERT statements for the same table?

Yes, all matching INSERT statements for the file are parsed and combined into one continuous set of CSV rows.

What if my INSERT statements don't list column names?

The tool falls back to generic labels like col1, col2, and so on, so the data is still usable even without the original field names.

Can it execute SQL functions or expressions used as values?

No, values are read as literal text from the statement; SQL functions, expressions, or subqueries are not evaluated or computed.

Does it handle commas inside quoted string values correctly?

Yes, the parser respects single and double-quoted strings, so commas and parentheses inside a value like an address won't break the row into extra columns.

Is my SQL file uploaded to a server?

No, all parsing and conversion happens locally in your browser using JavaScript.