No Login Data Private Local Save

SQL INSERT from CSV - Online Data to Statement

16
0
0
0

CSV to SQL INSERT Converter

Paste CSV data or upload a file — instantly generate SQL INSERT statements

Free & Online All processing is local — no data uploaded
CSV Input
Supports comma, semicolon, tab, and pipe delimiters. Fields with commas should be quoted with ".
Generated SQL
Your SQL will appear here...
Frequently Asked Questions

This tool converts CSV (Comma-Separated Values) data into SQL INSERT statements. Simply paste your CSV data or upload a .csv file, configure the table name and database type, and instantly get ready-to-run SQL code. It's perfect for data migration, seeding databases, or generating test data.

We support MySQL, PostgreSQL, SQL Server, SQLite, and Oracle. Each database has slightly different SQL syntax — the tool automatically adjusts the output format. For Oracle, individual INSERT statements are generated (since traditional Oracle doesn't support multi-row VALUES clauses). For all others, efficient batch INSERT syntax is used.

Fields containing commas, double-quotes, or line breaks should be wrapped in double-quotes per RFC 4180. Double-quotes inside fields must be escaped by doubling them (""). The parser automatically handles these cases. Single quotes in values are escaped as two single quotes ('') in the SQL output to prevent syntax errors.

When enabled, the tool attempts to detect numeric values and outputs them without quotes in the SQL (e.g., 42 instead of '42'). Integers, decimals, and scientific notation are recognized. NULL values are also rendered without quotes. Disable this if you want all values treated as strings — useful for phone numbers, zip codes, or IDs with leading zeros.

Batch size controls how many rows are grouped into a single INSERT statement. For example, with batch size 100, every 100 rows produce one INSERT. This is useful for very large datasets — smaller batches can improve performance and avoid hitting database packet size limits. Select "All rows" to put everything in one statement.

100% safe. All CSV parsing and SQL generation happens locally in your browser using JavaScript. No data is ever uploaded to any server. You can verify this — the tool works even when you're offline. This makes it suitable for sensitive or confidential data.

By default, the tool treats the first row as column headers. If your CSV doesn't have headers, uncheck "First row is header" — the tool will auto-generate column names (column_1, column_2, etc.). You can also manually edit the column names by typing them into the table name or using the preview table.

Enable "Empty values → NULL" in advanced options to convert blank CSV fields to SQL NULL (unquoted). Without this, empty fields become empty strings (''). If your CSV contains the literal text "NULL" or "null", enable smart type detection to have them recognized as SQL NULL values automatically.