CSV to SQL converter
Generate a CREATE TABLE statement with inferred column types and batched INSERT statements from any CSV, ready to paste into PostgreSQL, MySQL, SQLite or SQL Server.
Loading the tool…How to use it
- Paste CSV or drop a file.
- Pick the SQL dialect, table name and batch size.
- Copy or download the .sql script.
Private by design
The conversion runs as JavaScript in this tab. Your data is not uploaded, logged or stored. There is no account and no file-size paywall.
Type inference
Each column is scanned: whole numbers become INTEGER (or BIGINT past 2,147,483,647), decimals NUMERIC (REAL in SQLite), true/false BOOLEAN (BIT in SQL Server), YYYY-MM-DD values DATE, and everything else text. Columns with leading-zero codes stay text. Check the types before running against production.
Quoting and escaping
Identifiers are quoted in the dialect’s style ("col" for PostgreSQL and SQLite, `col` for MySQL, [col] for SQL Server), and single quotes inside values are doubled, so names like O’Brien do not break the statement.
For very large files
INSERT scripts are convenient for thousands of rows. For millions, native bulk loaders are much faster: COPY in PostgreSQL, LOAD DATA INFILE in MySQL, .import in SQLite and BULK INSERT in SQL Server all read CSV directly.
Questions
Is my file uploaded anywhere?
No. The file is read by JavaScript in this tab and never leaves your device. You can load the page, switch off Wi-Fi and it keeps working.
Why are empty cells NULL?
With “Leave numbers, booleans & blanks unquoted” on, blank cells become NULL. Turn it off to insert empty strings instead.
Can I batch rows into one INSERT?
Yes, choose rows per INSERT. Multi-row inserts are much faster to execute.