Converter Tools
CSV to SQL Converter
Convert CSV to SQL INSERT statements for MySQL, PostgreSQL, SQLite, and SQL Server. Multi-row, batched, or one per row, with NULL and type detection.
Dialect
Output mode
Use schema.table to qualify. Identifiers are quoted automatically when they need it.
Delimiter
Detected: Comma
NULL handling
Conversion runs entirely in your browser. The CSV you paste is never uploaded.
How to use
- Paste your CSV into the input area on the left, or click Load sample to try the converter on a worked example. Tab-separated, semicolon-separated, and pipe-separated files are also accepted.
- Enter the target table name. Use schema.table to qualify (for example public.users). Identifiers with spaces, special characters, or reserved words are quoted automatically.
- Pick the SQL dialect that matches your target database. MySQL uses backticks, PostgreSQL and SQLite use double quotes, and SQL Server uses square brackets.
- Choose the output mode: Multi-row VALUES is the most compact, One INSERT per row is the most portable, and Batched groups rows into chunks of N per statement for large CSVs.
- Toggle Detect numbers and Detect booleans to control type coercion. Use NULL handling to map empty cells, the literal NULL, N/A, NA, or a custom token to SQL NULL.
- Click Copy SQL to copy the generated INSERT statements, then paste them into psql, mysql, sqlite3, sqlcmd, or your migration script.
About this tool
CSV to SQL Converter turns rows of CSV data into ready-to-run SQL INSERT statements for every major database. Paste a CSV export from Excel, Google Sheets, Numbers, an analytics dashboard, or a CLI dump, set the target table name, and the tool emits portable INSERT INTO statements that you can paste straight into psql, mysql, sqlite3, sqlcmd, or your favorite database client. Parsing follows the same RFC-4180-style scanner used by the CSV to JSON and CSV to Markdown tools on this site, so quoted fields, escaped quotes (""), embedded commas or newlines, and CRLF or LF row terminators all behave exactly as a spreadsheet expects. The delimiter dropdown supports comma, tab, semicolon, and pipe, plus an Auto mode that detects the most likely delimiter from the file's column-count consistency. Per-dialect identifier quoting is built in: MySQL and MariaDB use backticks, PostgreSQL and SQLite use double quotes, SQL Server uses square brackets, and the standard SQL profile uses double quotes. Identifiers are only quoted when they actually need it (whitespace, special characters, leading digits, or matching a well-known reserved word like 'order' or 'user'), and the right escape rule is applied inside quoted identifiers so column names with backticks, double quotes, or right brackets stay valid. Cell values are coerced into the right SQL literal: empty cells become NULL, and an optional NULL handling mode lets you also treat the strings NULL, N/A, NA, or any custom token (such as \N from PostgreSQL COPY) as NULL. Numbers that look like clean integers or decimals are emitted unquoted, with a heuristic that intentionally keeps identifier-like values such as 007 or scientific-notation phone numbers as strings to avoid silent data damage. Truthy and falsy strings (true, false, yes, no, t, f, 1, 0) become TRUE or FALSE on MySQL, PostgreSQL, and the standard profile, and 1 or 0 on SQL Server and SQLite, which match those engines' canonical boolean representations. String literals always use single quotes with doubled embedded quotes, which is the portable form accepted by every dialect. Three output shapes are supported: a single multi-row VALUES list (the most compact form, ideal for MySQL, PostgreSQL, and SQLite seed scripts), one INSERT per row (the most portable shape, safe even on engines that do not allow multi-row VALUES), and batched mode where rows are grouped into chunks of N (any value from 1 to 1000) per statement so very large CSVs stay under per-statement size limits. Useful for seeding test databases from spreadsheets, importing analytics or audit exports into a reporting database, replaying CSV snapshots into staging, prototyping schemas before bulk loaders are ready, generating SQL fixtures for unit tests, and any time the database client you have on hand does not have a built-in CSV importer. Parsing and emission run entirely in your browser. The CSV you paste, including any customer data, internal IDs, or PII, never leaves your device.
Free to use. Works in your browser. No signup, no login.
Related tools
You may also like
CSV to JSON Converter
Two-way CSV and JSON converter with delimiter and header controls.
Open tool
ConverterJSON to CSV Converter
Convert JSON arrays to CSV with nested flattening and Excel-friendly options.
Open tool
ConverterCSV to Markdown Table Converter
Turn CSV or TSV into a clean Markdown pipe table with alignment and a live preview.
Open tool
ConverterCSV Viewer
View any CSV as a sortable, filterable, paginated table.
Open tool
DeveloperSQL Formatter
Pretty print SQL with configurable keyword case, indent, and comma style.
Open tool