SQL to CSV

Extract data from SQL to CSV

About SQL to CSV

SQL to CSV extracts data from INSERT INTO ... VALUES (...) statements in pasted SQL text and turns them into CSV rows, entirely in your browser — nothing is uploaded to a server. It doesn't run a database or execute SELECT queries. Parsing the value list is quote-aware: a comma or closing parenthesis inside a quoted SQL string (like 'Smith, John' or 'Smith (Jr)') is treated as literal data rather than a delimiter, and a doubled '' inside a value is unescaped to a single quote. Output CSV fields are quoted per the standard convention whenever a value contains a comma, quote, or newline.

How to use SQL to CSV

  1. 1Paste SQL text containing one or more INSERT INTO ... VALUES (...) statements.
  2. 2Click 'Convert' to extract the column names and values into CSV rows.
  3. 3Review the output, especially for values containing commas.
  4. 4Click 'Copy' to copy the CSV to your clipboard.

Frequently Asked Questions

Does it run my SQL against a database or convert SELECT query results?

No — it doesn't execute any SQL. It only pattern-matches the text of INSERT INTO ... VALUES (...) statements you paste in.

Is SQL to CSV free to use?

Yes, it's completely free with no signup required.

Can I customize the CSV delimiter?

No, output always uses commas — there's no option for semicolons, tabs, or pipes.

Does it handle values containing commas?

Yes — a quoted SQL string like 'Smith, John' is parsed as a single value, and the resulting CSV field is quoted too if needed, so it stays as one column rather than splitting apart.

Tips & Tricks

  • This tool only works with INSERT statement text — it can't process SELECT queries or connect to an actual database.
  • Values are parsed with SQL's own quoting rules, so commas and even closing parentheses inside a quoted string (e.g. 'Smith (Jr)') are handled correctly.
  • Headers come from the column list in the first matching INSERT statement — make sure it's representative of the rest.
  • Output CSV fields are quoted automatically whenever a value contains a comma, quote, or newline.