Free SQL export tool — no upload, no account

Convert SQL to CSV
Extract database
data instantly.

Free SQL to CSV converter. Upload a .sql file to extract data from INSERT statements, or paste query output directly from MySQL, PostgreSQL, SQLite or SQL Server. Runs entirely in your browser.

Your data never leaves your browser
INSERT file mode
Paste query output
Copy to clipboard
Always free
SQL to CSV Converter  100% client-side
Drop your .sql file here
INSERT statements extracted automatically — multi-row and batched inserts supported
Paste SQL query output here
 Export complete

      
How to convert SQL to CSV

Two input modes for two common workflows.

1
Choose your input mode

SQL INSERT file — for .sql dump files from mysqldump, pg_dump or SQLite. CSVShift parses every INSERT INTO … VALUES block and extracts column names and row data. Handles single-row and multi-row batch inserts, quoted strings and NULL values. SQL Query Output — paste the text output from any SQL client terminal directly.

2
Upload or paste your data

In INSERT mode, drop your .sql file and CSVShift counts the INSERT statements before you convert. In Query Output mode, copy the result from your SQL client (MySQL Workbench, psql, DBeaver, DataGrip) and paste it into the text area. Tab, pipe and space-aligned formats are all detected automatically.

3
Download or copy the CSV

Preview the first 10 rows to verify the column structure, then download the .csv file or copy it to your clipboard. The output is RFC 4180 compliant — compatible with Excel, Google Sheets and any database import tool.

How to export CSV from your database

Native commands for each database — before or instead of using this tool.

MySQL
-- Native CSV export SELECT * FROM table INTO OUTFILE '/tmp/out.csv' FIELDS TERMINATED BY ',' ENCLOSED BY '"' LINES TERMINATED BY '\n'; -- Or paste Workbench output here
PostgreSQL
-- Native CSV export COPY table TO '/tmp/out.csv' WITH (FORMAT CSV, HEADER); -- Or from psql: \copy (SELECT * FROM t) TO 'out.csv' CSV HEADER;
SQLite
-- In sqlite3 CLI: .mode csv .headers on .output data.csv SELECT * FROM table; .output stdout -- Or paste sqlite3 output here
SQL Server
-- Using bcp utility: bcp "SELECT * FROM db.dbo.t" queryout out.csv -c -t, -S server -U user -- Or paste SSMS grid output here -- (copy → paste in Query Output mode)
When do you need SQL to CSV conversion?

Common situations where extracting SQL data into CSV is necessary.

Database backup analysis

SQL dump files from mysqldump or pg_dump contain INSERT statements. Converting them to CSV lets you analyse the data in Excel or Google Sheets, or re-import it into a different database system, without needing a running database instance.

Database migration

When migrating from one database system to another — MySQL to PostgreSQL, SQLite to MySQL — exporting the source data as CSV and re-importing is often simpler than converting the SQL dump directly, which requires adapting syntax differences between dialects.

Ad-hoc reporting

When a database query result needs to be shared with a non-technical colleague, copying the output from a SQL client and converting to CSV produces a clean spreadsheet without requiring database access on the recipient's side.

Audit and compliance

Compliance teams often need transaction or event data extracted from databases as immutable CSV records. Converting SQL query results to CSV produces a portable, auditable snapshot that can be archived or sent to external auditors.

Related CSV tools

Other free converters on CSVShift you might need.

Popular searches
sql to csv converter export sql query to csv sql export to csv mysql export to csv export from sql to csv psql export to csv sqlite to csv converter sql server export to csv export mssql to csv sql save to csv convert sql insert to csv sql dump to csv

SQL data parsed
in your browser. No upload.

CSVShift processes SQL files and query output entirely in your browser. Your .sql dump file — which may contain sensitive production data — is never uploaded to any server. Both the INSERT parser and the query output parser run in JavaScript locally on your device.

The INSERT parser handles single-quote escaping, NULL values, multi-row batch inserts, backtick and double-quote identifiers, and the various whitespace styles produced by different database tools.

INSERT statement parser
Handles single-row and multi-row VALUES, quoted strings, NULL values, escaped quotes and mixed whitespace.
Query output parser
Detects tab, pipe and space-aligned formats from MySQL, psql, sqlite3, DBeaver and SSMS.
Paste directly
No file needed — copy query results from your SQL client and paste into the text area for instant conversion.
Free, no conditions
No row limit, no file size cap, no watermark. Funded by display advertising only.
Frequently asked questions
Common questions about converting SQL data to CSV format.
How do I export SQL query results to CSV?
Two options: 1) Use your database's native export command (see examples above for MySQL, PostgreSQL, SQLite and SQL Server). 2) Copy the query result from your SQL client (MySQL Workbench, DBeaver, DataGrip, psql), switch to Query Output mode in CSVShift, paste it in, and download the CSV.
How do I convert SQL INSERT statements to CSV?
Upload your .sql file in INSERT File mode. CSVShift parses every INSERT INTO … VALUES block — including multi-row batch inserts — extracts column names from the column list, and builds a CSV row for each data tuple. NULL values become empty cells in the CSV output.
How do I export MySQL to CSV?
Three approaches: 1) SELECT * FROM table INTO OUTFILE '/tmp/out.csv' FIELDS TERMINATED BY ',' — fastest but requires server file access. 2) Copy grid results from MySQL Workbench and paste in Query Output mode here. 3) Use mysqldump to get a .sql file, then upload it in INSERT File mode.
How do I export PostgreSQL to CSV?
Use \copy (SELECT * FROM table) TO 'file.csv' CSV HEADER; from the psql CLI. Alternatively, copy the result grid from pgAdmin or DBeaver and paste it into CSVShift's Query Output mode — tab-separated format is detected automatically.
Is my database data safe when converting SQL online?
Yes. CSVShift processes everything in your browser. Your .sql file and any pasted query output are never transmitted to any server. Open the browser's Network inspector during conversion — zero outbound data requests are made.