Toolvist

SQL to CSV Converter

Parse SQL INSERT statements and export the rows as clean CSV you can open in any spreadsheet. Free SQL to CSV converter, no sign-up, no upload.

Paste INSERT statements from a dump or migration.

Ready.

Rows extracted

0

Columns

0

Statements

0

Tables

—

SQL to CSV Converter

Extract the data from SQL INSERT statements and export it as CSV. Handles quoted strings, escaped quotes, NULLs, numbers and nested function calls, so a database dump becomes a spreadsheet in seconds.

The reverse is the CSV to SQL Converter, and formatting the underlying statement is the job of the SQL Formatter & Beautifier. For the JSON equivalent of the same rows, the CSV to JSON Converter is the tool.

How to use the SQL to CSV

  1. 1 Paste the result set — the rows as text, or the insert statements.
  2. 2 Confirm the column names and the order.
  3. 3 Choose the delimiter and quoting rules.
  4. 4 Download the CSV.

Moving data out

Exporting a result set to CSV is the universal interchange step. Every spreadsheet, analysis tool and bulk importer accepts it, which makes it the pragmatic bridge between a database and everything that cannot speak SQL.

The information lost is mostly type information. Numbers become text, nulls become empty, and dates become strings in whichever format the exporter chose. Reimporting therefore requires the types to be reapplied deliberately, which is why the column definitions are worth preserving alongside the file.

  • Tabs are safer than commas when copying from a grid.
  • NULL and empty string are indistinguishable in CSV.
  • Quote fields that contain the delimiter, quotes or newlines.
  • Preserve the column types separately if the data will be reimported.

Frequently asked questions

How do I get a result set into a pasteable form?

Most database clients can export results as CSV, tab-separated text or SQL inserts directly, and that is usually the better route than copying the grid. If you are copying from a grid, tabs are the more reliable separator because the client typically copies them, and a value containing a comma will not break the columns.

What happens to NULL in CSV?

It becomes an empty field, which is indistinguishable from an empty string. That ambiguity is inherent to CSV, and the distinction is lost the moment the data leaves the database. If it matters, a sentinel value or a separate marker column is needed.

Why do timestamps change format?

Because the client and the spreadsheet apply their own conventions. A database timestamp with a time zone may be rendered in local time on export and then reinterpreted by the spreadsheet as a date in the viewer's time zone, shifting it. For data that must be precise, export in a fixed format and import as text.

Related Developer Tools

Browse all Developer Tools →

You might also need

Tools from other categories that people pair with the SQL to CSV:

Browse the full tool directory →