Skip to content
TabKiwiTabKiwi

CSV to SQL

Load a CSV file into SQL: a CREATE TABLE with guessed column types followed by INSERT statements.

DeveloperRuns in your browser. Your files never leave this device.
Loading tool…

About this tool

Paste CSV with a header row and get a script that creates a table and fills it. Column types are guessed from the data, so whole numbers become INTEGER, decimals become a floating type, true and false become booleans and ISO dates become DATE or TIMESTAMP. Empty cells can be written as NULL, and the output follows the quoting rules of PostgreSQL, MySQL, SQLite or SQL Server. Parsing happens on your device.

How to use CSV to SQL

  1. Paste CSV whose first row holds the column names.
  2. Enter a table name and pick your database.
  3. Check the inferred CREATE TABLE and adjust types if needed.
  4. Copy or download the SQL script.

Frequently asked questions

Which delimiters are supported?

Commas, semicolons, tabs and pipes are detected automatically, and quoted fields with embedded commas or line breaks are parsed correctly.

Why is a column with leading zeros kept as text?

Values such as ZIP codes or 007 would lose their zeros as numbers, so they are left as strings.

More Developer tools

View all 91 →