Go to Sign up
Note: Your files never leave your device. We don't upload, transfer, or store your data.
|
|
|
|
|---|---|---|
|
|
|
SQL (Structured Query Language) is the standard language for interacting with relational databases. Two of the most common operations are:
DDL (Data Definition Language) — CREATE TABLE statements that define table structure, column names, data types, and constraints
DML (Data Manipulation Language) — INSERT INTO statements that populate tables with rows of data
Converting CSV data to SQL means transforming spreadsheet-style data into executable SQL scripts that can be run directly against a database.
A CSV to SQL converter takes comma-separated or tab-separated data and generates valid SQL statements. Instead of manually writing hundreds of INSERT lines, you paste your CSV and get a ready-to-run .sql file.
This is useful when:
Importing data from spreadsheets into a relational database
Generating seed data for development and testing
Migrating data between systems via SQL scripts
Creating database schemas from existing data structures
The converter supports four SQL dialects, each with specific syntax differences.
CREATE TABLE `users` (
`id` INT, `name` TEXT,
`email` TEXT,
PRIMARY KEY (`id`)
);
INSERT INTO `users` (`id`, `name`, `email`) VALUES (1, 'Alice', '[email protected]');
MySQL uses backticks for identifier quoting and supports DROP TABLE IF EXISTS.
CREATE TABLE "users" (
"id" INT, "name" TEXT,
"email" TEXT,
PRIMARY KEY ("id")
);
INSERT INTO "users" ("id", "name", "email") VALUES (1, 'Alice', '[email protected]');
PostgreSQL uses double quotes for identifiers and supports DROP TABLE IF EXISTS.
CREATE TABLE "users" (
"id" INT, "name" TEXT,
"email" TEXT, PRIMARY KEY ("id")
);
INSERT INTO "users" ("id", "name", "email") VALUES (1, 'Alice', '[email protected]');
SQLite has a simplified type system. It does not support DROP TABLE IF EXISTS in all versions — the converter handles this based on the selected dialect.
CREATE TABLE [users] (
[id] INT, [name] TEXT,
[email] TEXT,
PRIMARY KEY ([id])
);
INSERT INTO [users] ([id], [name], [email]) VALUES (1, 'Alice', '[email protected]');
SQL Server uses square brackets for identifier quoting and supports DROP TABLE IF EXISTS (SQL Server 2016+).
Enable Create Table to include a CREATE TABLE DDL statement at the top of the output. The converter generates column definitions based on your header row. Data types default to TEXT unless inferred otherwise.
Enable Drop Table (If Exists) to prepend a DROP TABLE IF EXISTS statement before the CREATE TABLE. This ensures the script is idempotent — safe to run multiple times without errors.
Enter a Table Name in the Properties panel. This name is used in both the CREATE TABLE and INSERT INTO statements. If left blank, a default name is used.
Specify a Primary Key column name. The converter adds a PRIMARY KEY constraint to the CREATE TABLE statement for the specified column.
Enable Batch Insert to combine multiple rows into a single INSERT INTO ... VALUES statement:
-- Batch Insert (ON)INSERT INTO `users` (`id`, `name`) VALUES(1, 'Alice'),(2, 'Bob'),(3, 'Charlie');-- Individual Inserts (OFF)INSERT INTO `users` (`id`, `name`) VALUES (1, 'Alice');INSERT INTO `users` (`id`, `name`) VALUES (2, 'Bob');INSERT INTO `users` (`id`, `name`) VALUES (3, 'Charlie');Batch inserts are faster to execute and produce smaller SQL files.
Enable Pretty Print to format the SQL output with line breaks and indentation. Disable it for compact single-line output.
After uploading your CSV or TSV file, the built-in editor lets you:
Add, delete, and reorder rows and columns
Transpose rows to columns
Remove empty rows and duplicate rows
Apply case transformations (UPPERCASE, lowercase, Capitalize)
Find and replace values (with regex support)
All processing happens in your browser. Your CSV data is never uploaded to any server.
Drag and drop a .csv or .tsv file onto the upload area, or click to browse. Alternatively, click Enter Data to type values directly into the table editor.
Use the toolbar to modify your data. Insert or remove rows and columns, transpose the table, deduplicate rows, or apply bulk case changes.
In the Properties panel, choose your target database: MySQL, PostgreSQL, SQLite, or SQL Server.
Table Name — enter the target table name
Primary Key — specify the primary key column (optional)
Create Table — toggle on to include CREATE TABLE in the output
Drop Table (If Exists) — toggle on to add DROP TABLE IF EXISTS before create
Batch Insert — toggle on to combine rows into a single INSERT
Pretty Print — toggle on for formatted output
Click Convert. The SQL script appears in the Output Data panel.
Click Copy to Clipboard to paste the SQL into your database client, or use Download File (Premium) to save the .sql file.
Data migration — Import Excel or Google Sheets data into MySQL, PostgreSQL, SQLite, or SQL Server
Database seeding — Generate INSERT scripts for development and test databases
Schema prototyping — Create CREATE TABLE statements from existing CSV headers
ETL workflows — Convert CSV exports to SQL as part of an extract-transform-load pipeline
SQL tutorials — Generate sample INSERT data for educational content
Backup and restore — Convert CSV data exports into SQL scripts for database restoration
The converter supports four SQL dialects: MySQL, PostgreSQL, SQLite, and SQL Server (T-SQL). Each dialect generates correctly quoted identifiers and syntax-appropriate statements.
Batch insert combines multiple data rows into a single INSERT INTO ... VALUES statement with comma-separated value tuples. Individual insert generates a separate INSERT statement for each row. Batch inserts execute faster and produce smaller SQL files.
No. All conversion happens entirely in your browser. Your files are never uploaded, transferred, or stored on any server.
Enable the 'Create Table' toggle in the Properties panel. The converter generates a CREATE TABLE DDL statement with column definitions based on your header row. You can also enable 'Drop Table (If Exists)' to make the script idempotent.
Yes. Enter the column name in the 'Primary Key' field in the Properties panel. The converter adds a PRIMARY KEY constraint to the CREATE TABLE statement for that column.
When enabled, the converter adds a DROP TABLE IF EXISTS statement before the CREATE TABLE statement. This makes the SQL script safe to run multiple times without causing 'table already exists' errors.
Pretty Print formats the SQL output with line breaks and indentation for readability. When disabled, the output is compact single-line SQL, which is useful for minimizing file size.
Yes. After uploading your file, a full table editor opens where you can add or remove rows and columns, transpose the table, deduplicate rows, change text case, and find and replace values.