CSV to SQL (INSERT and CREATE TABLE)
Convert CSV or data copied from Excel into SQL INSERT statements, with CREATE TABLE and automatically detected types, for MySQL, PostgreSQL, SQLite and SQL Server.
How to usePaste the CSV with the header in the first row.
CSV to SQL (INSERT and CREATE TABLE): what it is for
Paste a CSV or cells copied from Excel with the header in the first row. The tool detects the separator, checks each column to choose its type (INTEGER, DECIMAL, DATE, BOOLEAN or VARCHAR), escapes quotes, turns empty cells into NULL and generates the INSERT statements, in batches of 500 rows or one per row, with the right name quoting for each database.
The data is not sent to any server: the conversion happens in your browser.
How to use
- Paste the CSV with its header.
- Choose the database, table name and options.
- Copy or download the SQL.
When to use it
- Importing spreadsheets into a database.
- Creating test data from Excel.
- Moving lists into a new table.
Frequently asked questions
How are the column types detected?
The tool checks every value in each column: only integers becomes INTEGER, numbers with decimals become DECIMAL, dates in YYYY-MM-DD format become DATE, true/false becomes BOOLEAN and everything else becomes VARCHAR with the length of the longest value.
What about quotes and special characters?
Text is escaped by doubling single quotes, as the SQL standard requires. Empty cells become NULL.
What changes between databases?
The way names are quoted: backticks in MySQL, double quotes in PostgreSQL and SQLite, and square brackets in SQL Server.
Is it really free?
Yes, 100% free. No sign-up, no subscription and no usage limits. All Tools123 tools are free and run right in your browser.