convert-csv.com logo convert-csv.com

Convert SQL to CSV / Excel

Parse SQL INSERT statements into CSV or Excel rows without running a database.

100% Secure - your files are processed in your browser and never sent to a server.
Drop your file hereor click to browseSupports SQL or TXT files (.sql, .txt) (Max 100MB)

SQL files contain structured data in the form of INSERT statements, CREATE TABLE definitions, and sometimes SELECT query results. Converting SQL to CSV extracts row data from these statements into a flat, portable format. This tool parses SQL INSERT, CREATE TABLE, and SELECT statements to extract column names and row values. It handles multi-row INSERT syntax, quoted strings with escaped characters, numeric values, NULL literals, and date/time values. The parser understands common SQL dialects including MySQL, PostgreSQL, and SQLite syntax variations. You paste SQL directly into the text area or load a .sql file, and the tool outputs a properly formatted CSV with headers derived from the column names in the INSERT or CREATE TABLE statement. All parsing happens in your browser, which is important because SQL dumps often contain sensitive data like user records, financial transactions, or proprietary business data. The tool handles files up to 100 MB and processes them in a Web Worker to keep the interface responsive.

How to use the Convert SQL to CSV tool

  1. Load your SQL data: Drag and drop your .sql file, choose a file from your file explorer, or paste SQL statements directly into the paste area.
  2. Configure output settings: Choose a CSV delimiter (comma, semicolon, tab, or pipe) and toggle whether the first row is a header.
  3. Convert to CSV: Click the "Convert Data" button to parse SQL INSERT, CREATE, or SELECT statements into CSV rows.
  4. Export results: Copy the results to your clipboard, download as a local file, or export to Excel format.

Frequently asked questions

What types of SQL statements can this tool parse?
The parser handles INSERT INTO statements (both single-row and multi-row syntax), CREATE TABLE definitions (to extract column names), and SELECT query results. The most common use case is extracting data from INSERT dumps.
Does it handle SQL from different database dialects?
Yes. The parser handles MySQL, PostgreSQL, SQLite, and Microsoft SQL Server syntax variations, including different quoting styles, escape sequences, and date literal formats.
How are NULL values represented in the CSV output?
NULL values are output as empty strings in the CSV cells. This is the standard convention for representing missing data in CSV format.
Can I convert a SQL dump file containing millions of rows?
Yes. The tool processes SQL files up to 100 MB using streaming parsing in a Web Worker. Very large dumps may take longer but the browser interface stays responsive.
Does the tool generate column headers from the SQL?
Yes. Column headers are derived from the column names in the INSERT statement or CREATE TABLE definition. If no column names are present, the tool generates generic headers (column_1, column_2, etc.).

Related tools