CSV to SQL Converter
Turn CSV rows into CREATE TABLE and INSERT statements.
Runs in your browser. Nothing is uploaded — your input is processed on this device and discarded when you close the tab.
CSV to SQL Converter
How to use this tool
- Paste CSV data with a header row on top and name the table.
- Press Convert to see a CREATE TABLE plus one INSERT per row.
- Use Load sample for a name containing an apostrophe, to show the quoting.
Worked example
The sample row O'Brien, 30 under table my_table produces INSERT INTO my_table (name, age) VALUES ('O''Brien', '30'); — the apostrophe is doubled, which is the SQL way to keep it inside the string. The CREATE TABLE line declares both columns as TEXT, because CSV carries no types.
What this tool does not do / Limits
All columns are declared TEXT and all values are quoted as strings, because CSV carries no types and guessing types could corrupt data. Identifiers are quoted with double quotes and internal double quotes are doubled. Always review the output before running it against a real database.
Frequently asked questions
Are numbers inserted as numbers?
No. Every value is quoted as text, which databases accept for numeric columns in most cases, but you may change the column types by hand.
Is the output safe to run?
Values are quoted by doubling single quotes, but you should still review the output and run it on a test database first.
Related tools
CSV Cleaning Studio
Remove duplicates, fix missing values, standardise dates and export a clean CSV. Your file never leaves your device.
LiveChart Builder
Build charts from CSV data with aggregation, sorting and accessible colour palettes. Export as PNG or SVG.
LiveLength Converter
Convert lengths between metric and imperial units and see the full table of equivalents.
Live