CSV to SQL INSERT Converter
Turn pasted CSV or TSV or a UTF-8 file into SQL INSERT statements. The converter runs in your browser, so your data stays on your device.
How to convert CSV to SQL INSERT statements
- Paste your data or choose a UTF-8 file. Pick the delimiter manually if needed. Each record must have the same number of columns.
- Enter a table name and choose your database. If the first row contains data, turn off the column names option to use
col1,col2, and so on. - Choose a batch size and enable Include CREATE TABLE if you need a new table. Review the SQL, then copy it or download a
.sqlfile.
FAQ
Which databases are supported? Choose MySQL, PostgreSQL, SQLite, or SQL Server for the quoting used by your database. The optional CREATE TABLE uses TEXT columns, or NVARCHAR(MAX) in SQL Server. MySQL values containing backslashes use the default backslash-escaping mode (with NO_BACKSLASH_ESCAPES disabled).
How are empty cells and numbers handled? Empty cells become '' by default. Enable the NULL option to emit NULL for empty cells. The numbers option emits plain integers and decimals such as -1.5 as numeric literals and keeps values such as 007 quoted.
Can I convert large files? The browser holds both the input and output in memory. Split files that are too large for your browser, keeping the header in each part if you use column names. Larger batches reduce the number of INSERT statements. For large imports, your database's bulk import tool may be faster.
Related tools include the CSV to JSON converter and the CSV to HTML table generator.