CSV to SQL
Convert CSV rows into a single SQL INSERT statement. Column names come from the header row.
Runs in your browser Instant No signup, no tracking
About this tool
Paste CSV with a header row and get a single batched `INSERT INTO ... VALUES (...), (...)` statement. Column names are sanitized to be SQL-safe. Values that look like numbers or booleans are emitted unquoted; everything else is quoted with single quotes and internal quotes are doubled per the SQL standard. The default table name is `my_table` — edit the first line of the output before running.
Example
Paste the input on the left and you will get output like this:
Sample CSV
id,name,email,active 1,Ada Lovelace,ada@example.com,true 2,Alan Turing,alan@example.com,true 3,Grace Hopper,grace@example.com,false
Resulting SQL
INSERT INTO my_table (id, name, email, active) VALUES (1, 'Ada Lovelace', 'ada@example.com', TRUE), (2, 'Alan Turing', 'alan@example.com', TRUE), (3, 'Grace Hopper', 'grace@example.com', FALSE);
How to use CSV to SQL
- Paste or type your CSV into the left pane.
- The SQL appears instantly in the right pane. Conversion runs in your browser — nothing is uploaded.
- Copy the result to your clipboard or download it as a file.
FAQ
- Which SQL dialect?
- Standard multi-row INSERT syntax, which works on PostgreSQL, MySQL 5.7+, SQLite, and SQL Server 2008+.
- How are NULLs handled?
- Empty cells and cells with the literal text `null` (any case) become SQL `NULL`.
- Can I set the table name?
- Not from the UI — edit the generated statement before running it. This keeps the tool zero-config.