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
- Paste CSV whose first row holds the column names.
- Enter a table name and pick your database.
- Check the inferred CREATE TABLE and adjust types if needed.
- 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.