CSV to SQL Generator
About CSV → SQL
CSV → SQL turns a header and data rows into a portable CREATE TABLE statement plus parameterized INSERT examples for PostgreSQL, MySQL or SQLite.
How it works
Conservative type inference
Each column is classified from all non-empty values as integer, number, boolean, date, timestamp or text. Mixed columns remain text so a single outlier is not silently coerced.
Dialect-aware definitions
Identifiers are normalized and quoted for the selected database, while inferred types map to appropriate PostgreSQL, MySQL or SQLite declarations.
Parameterized inserts
Cell values are emitted in JSON parameter comments and INSERT statements contain only placeholders. Use the SQL and parameter array with your database driver's prepared-statement API.
Frequently asked questions
Can I execute the generated INSERT text directly?
The statements contain placeholders. Pass each accompanying parameter array through your database driver's prepared-statement API.
Are empty cells NULL?
They are NULL when the option is enabled; otherwise they remain empty strings.
Does this connect to my database?
No. It only generates text locally and never opens a database connection.
Sources & last verified
The behaviour of this tool and the claims on this page were checked against the specifications below on . Everything runs in your browser, so the output you see is exactly what the engine produced.
Found a wrong result or an outdated claim? Report an error and it will be re-verified.