Convertee/Guide

How to Convert SQL to CSV: Complete Guide

Last updated: 2026-04-15

You have a SQL dump file full of INSERT INTO statements and you need the data in a spreadsheet. Or you are migrating away from one database and the export tool only gives you SQL. Whatever the scenario, extracting tabular data from SQL into CSV saves you from spinning up a database just to run a query.

Step-by-Step: Convert SQL to CSV with Convertee

  1. Open Convertee and select SQL as the source format and CSV as the target.
  2. Paste your SQL INSERT statements into the input panel, or drop a .sql file.
  3. Choose your delimiter (comma, tab, semicolon) and whether to include a header row.
  4. Click Convert (Cmd+Enter).
  5. Copy the CSV or download the file.

Convertee parses SQL entirely in the browser. No data leaves your machine, and no database engine is needed.

What SQL Input Is Supported?

Convertee extracts data from standard INSERT INTO statements. It supports single-row and multi-row inserts, quoted strings, numeric literals, NULL, and common escape sequences. The parser handles MySQL, PostgreSQL, and SQLite dialects.

INSERT INTO users (name, age, city) VALUES
  ('Alice', 30, 'Seoul'),
  ('Bob', 25, 'Tokyo'),
  ('Charlie', 35, 'Berlin');

Output CSV:

name,age,city
Alice,30,Seoul
Bob,25,Tokyo
Charlie,35,Berlin

Understanding the Formats

SQL INSERT Statements

SQL (Structured Query Language) is standardized by ISO/IEC 9075. The INSERT INTO statement adds rows to a table. Column names in parentheses define the header, and VALUES clauses supply the data.

CSV

CSV (RFC 4180) is the simplest tabular format. One row per line, fields separated by a delimiter, quotes around values that contain the delimiter or newlines.

Common Use Cases

Handling Edge Cases

Frequently Asked Questions

What SQL statements does Convertee parse?
Convertee parses standard INSERT INTO statements, including single-row and multi-row inserts. CREATE TABLE, DROP TABLE, and other DDL statements are ignored. It supports MySQL, PostgreSQL, and SQLite dialects.
How are NULL values represented in the CSV output?
SQL NULL values are converted to empty cells in CSV. This is consistent with how spreadsheets and most CSV parsers handle missing data.
Can I convert a full database dump file?
Yes, as long as the file is under 1 MB (free tier limit). Convertee will skip non-INSERT statements and extract data from all INSERT statements it finds.

Related Guides

Ready to convert? Try it now — no sign-up required.

Open Converter