Turn a CSV file into reviewable CREATE TABLE and INSERT statements for your SQL database, with explicit type and NULL controls before download.
Processed in your browserNo account requiredFour SQL dialectsComplete exports only
Drop a CSV file hereGenerate CREATE TABLE and batched INSERT statements locally. Maximum: 10 MB or 50,000 rows.
Choose a CSV file, or try the sample. Nothing is uploaded.
What this tool does
Convert CSV to SQL
This CSV to SQL converter reads the complete CSV locally and generates quoted CREATE TABLE and batched INSERT statements for PostgreSQL, MySQL, SQLite or SQL Server. You control the table name, empty-cell handling, batch size and conservative type inference. Quotes inside values are escaped, database identifiers use dialect-specific quoting, and inconsistent row widths block output instead of losing data.
How to use it
Choose a CSV or delimited TXT file, or use the sample, then review the detected rows and columns.
Select the SQL dialect, table name, batch size, type inference and NULL behavior.
Inspect normalized column names, inferred types, the CSV preview and generated SQL.
Download or copy the complete script, then test it in a non-production database before importing.
Common tasks
Convert CSV rows into batched SQL INSERT statements for PostgreSQL, MySQL, SQLite or Microsoft SQL Server.
Generate a CREATE TABLE statement with conservative integer, decimal, boolean and text type inference.
Create a downloadable SQL script locally while preserving every valid CSV row and keeping empty-cell handling explicit.
Privacy and local processing
Your file is read and converted by browser code on this page. File contents and filenames are not sent to a CSV Dock application server or included in analytics. The converter does not connect to external map services or databases.
Supported edge cases
Duplicate or empty CSV headers receive visible, deterministic SQL column names instead of overwriting data.
Single quotes in values and reserved words in table or column names are escaped with the selected SQL dialect's syntax.
Leading-zero values and numbers outside conservative database ranges remain text rather than being coerced.
Any row with a different number of columns blocks SQL generation; blank physical lines are ignored.
Frequently asked questions
How do I convert CSV to SQL INSERT statements?
Choose the CSV, select your database dialect and table name, review the parsed rows and inferred types, then copy or download the generated INSERT statements.
Which SQL databases are supported?
The generator supports PostgreSQL, MySQL, SQLite and Microsoft SQL Server quoting, data types and boolean literals. Review the result if your database uses custom types or constraints.
Does this import the CSV into my database?
No. It creates a SQL script in your browser and never connects to a database. You decide where and when to run the downloaded statements.
How are empty cells and data types handled?
Empty cells become NULL by default, or empty strings if you turn that option off. Type inference is optional and deliberately leaves leading-zero identifiers and ambiguous values as text.
Is this CSV to SQL converter online and free?
Yes. The page generates the SQL locally in your browser without an account, upload endpoint or paid conversion step.