CSV to SQL INSERT Conversion
Convert CSV data to SQL INSERT statements. Choose separator (comma/tab) and table name; enter text or upload a file (up to 100KB) for real-time INSERT output.
Separator
How to use
About this tool
Converts CSV to SQL INSERT statements.
How to use
Choose separator (comma/tab) and table name; enter CSV or load from file to see INSERT statements in real time and copy.
Options
Separator: comma or tab. Table name: name of the table in generated INSERTs (default: table_name).
Use cases
• Converting spreadsheet/export CSV to DB INSERTs • Generating SQL for bulk test data • Creating migration or seed data
Code Examples
1id,name,score
21,Tanaka,85
32,Sato,92
43,Suzuki,781INSERT INTO users (id,name,score) VALUES ('1','Tanaka','85');
2INSERT INTO users (id,name,score) VALUES ('2','Sato','92');
3INSERT INTO users (id,name,score) VALUES ('3','Suzuki','78');How it works
■ What is CSV? CSV (Comma-Separated Values) is a plain-text data format delimited by commas or tabs. Widely used for spreadsheet exports and data import/export. ■ What is SQL INSERT? SQL INSERT statements add rows to database tables. Used for test data seeding, initial data migration, batch imports, etc. ■ How conversion works The first row is treated as headers (column names); subsequent rows are converted to INSERT INTO table (col1, col2, ...) VALUES ('val1', 'val2', ...); format. Strings are escaped with single quotes. All processing runs in the browser.
FAQ
- Q: How should I format the CSV input?
- A: The first row must be column headers. Subsequent rows are data rows. Choose comma or tab as the delimiter to match your file. Fields containing commas or newlines should be wrapped in double quotes.
- Q: Can I change the table name?
- A: Yes. Enter the desired table name in the "Table name" field. The default is "table_name". This name is used in every generated INSERT INTO statement.
- Q: Are string values automatically escaped?
- A: Yes. String values are wrapped in single quotes and single quotes within values are escaped (e.g. O'Brien becomes O''Brien in SQL).
- Q: Can I import the generated SQL directly into MySQL or PostgreSQL?
- A: Yes. Copy the output and run it via your database client (mysql CLI, psql, TablePlus, DBeaver, etc.) or paste it into a migration file. All values are treated as strings; cast types in your DB schema as needed.
- Q: Does this tool send my data to a server?
- A: No. All conversion is performed entirely in the browser. Your CSV data is never sent to any server.
