About this tool
CSV to SQL is a free, in-browser generator that converts a pasted CSV into SQL statements: an optional CREATE TABLE with inferred column types plus one escaped INSERT per row. It all happens on your device, so your data is never uploaded.
The tool inspects each column and infers whether it is an integer, decimal, date, or text value, then maps those to the right types and identifier quoting for your chosen dialect — MySQL, PostgreSQL, SQLite, or SQL Server. String values are safely escaped, empty cells become NULL, and numeric cells stay unquoted.
Because it runs locally it is a private, offline-friendly way to load spreadsheet data into a database without an import wizard, and you can copy the SQL or download it as a .sql file.
Frequently asked questions
How are column types inferred?
A column is typed as integer when every non-empty value is a whole number, decimal when values are numeric with fractions, date when they match YYYY-MM-DD (optionally with a time), and text otherwise. Blank cells are emitted as NULL.
What changes between dialects?
Identifier quoting and type names differ: MySQL uses backticks and INT/VARCHAR, PostgreSQL and SQLite use double quotes (SQLite favours INTEGER/REAL/TEXT), and SQL Server uses square brackets with NVARCHAR. String literals are single-quoted with inner quotes doubled in every dialect.
What CSV conventions are assumed?
Fields are split on your chosen delimiter, double-quoted fields (inner quotes doubled) are parsed so embedded delimiters survive, and the first row is used as column names when the header box is ticked (otherwise column1, column2 … are used).
Can I skip the CREATE TABLE?
Yes. Untick the CREATE TABLE option to emit only the INSERT statements — handy when the destination table already exists and you just need the rows.
More tools