CSV to SQL
Convert CSV data to SQL INSERT statements or generate a CREATE TABLE DDL with inferred column types.
About the CSV to SQL Converter
CSV is the most common format for data exports — spreadsheets, database dumps, analytics reports. Getting that data into a SQL database means writing INSERT statements by hand or using a bulk import tool. This converter does it instantly: paste your CSV, choose your dialect, and get ready-to-run INSERT statements or a CREATE TABLE DDL with automatically inferred column types.
What this tool generates
INSERT Statements
Batched INSERT statements with configurable batch size. Proper escaping for strings, nulls, and special characters across all four dialects.
CREATE TABLE DDL
A complete CREATE TABLE statement with column names from the CSV header row and inferred types — INTEGER, DECIMAL, BOOLEAN, DATE, or VARCHAR.
Type Inference
Automatically detects integers, decimals, booleans, ISO dates, and strings. No manual schema definition needed for most datasets.
Multi-Dialect Support
PostgreSQL, MySQL, SQLite, and MSSQL — each with correct quoting, data type names, and syntax conventions.
Common use cases
- Importing spreadsheet exports into a development database
- Seeding test databases with realistic data
- Migrating data between systems via SQL scripts
- Scaffolding a table schema from a data file
Pipeline
- SQL Formatter — format the generated SQL for readability.
- JSON Formatter — if your source data is JSON, format it before converting.
Frequently asked
- Is my CSV data sent to a server?
- No. All parsing and SQL generation run 100% in your browser. Your data — including any sensitive values — never leaves your device.
- What SQL dialects are supported?
- PostgreSQL, MySQL, SQLite, and MSSQL. Each dialect uses the correct identifier quoting convention: double quotes for PostgreSQL, backticks for MySQL, square brackets for MSSQL.
- How does automatic type detection work?
- The tool samples values in each column and infers the type: INTEGER for whole numbers, DECIMAL for floats, BOOLEAN for true/false/yes/no, DATE for ISO date strings, and TEXT/VARCHAR for everything else.
- What is batch INSERT and why does it matter?
- A batch INSERT combines multiple rows into a single statement (e.g. INSERT INTO t VALUES (1,...),(2,...),(3,...)). This is significantly faster than individual INSERTs because it reduces round-trips to the database. The batch size is configurable.
- Can I generate a CREATE TABLE statement from my CSV?
- Yes. Switch to the DDL tab to get a CREATE TABLE statement with inferred column types. You can use this to quickly scaffold a table schema from a data export.