CSV to SQL INSERT Converter
Convert CSV or TSV data into SQL INSERT statements with smart type inference (int/decimal/boolean/date/text), NULL vs empty-string handling, RFC 4180-correct parsing, batched multi-row inserts, optional CREATE TABLE, and UPSERT (ON CONFLICT / DUPLICATE KEY / MERGE). Multi-dialect (ANSI/MySQL/PostgreSQL/SQLite/T-SQL). 100% client-side.
About CSV to SQL INSERT Converter
Convert CSV or TSV data into SQL INSERT statements with smart type inference (int/decimal/boolean/date/text), NULL vs empty-string handling, RFC 4180-correct parsing, batched multi-row inserts, optional CREATE TABLE, and UPSERT (ON CONFLICT / DUPLICATE KEY / MERGE). Multi-dialect (ANSI/MySQL/PostgreSQL/SQLite/T-SQL). 100% client-side. Everything runs locally in your browser — your data never leaves your device.
How to use
- Enter your input in the tool above.
- Adjust any options to your preference.
- Use the Copy or Download buttons to save the result.
- Everything happens locally — your data never leaves your browser.
FAQ
How does the CSV to SQL converter handle quoting?
We use an RFC 4180-compliant parser that correctly handles fields wrapped in double quotes, embedded commas inside quoted fields, doubled-quote escapes (""), and embedded newlines. A leading BOM is stripped automatically and CRLF, lone CR, and LF line endings are all accepted.
How are column types inferred?
For each column we sample every non-NULL value and check whether it consistently looks like an integer (no leading zeros), a decimal, a boolean (true/false), or a date (YYYY-MM-DD or ISO datetime). Otherwise we fall back to TEXT. Inferred types drive both the CREATE TABLE column type and the INSERT literal format (numeric values unquoted, strings escaped and quoted, NULLs emitted as NULL).
How are NULLs handled?
By default, the literal token 'NULL' (case-insensitive) and empty cells are emitted as SQL NULL. You can configure the NULL token (e.g. '\\N' for PostgreSQL COPY style) and toggle whether empty cells become NULL or empty strings. NULLs are never quoted, so the generated SQL loads cleanly without type errors.
What insert modes are supported?
Three: single-row INSERTs (one statement per row), batched multi-row INSERTs (configurable batch size, default 100 — much faster for large imports), and UPSERT. UPSERT emits ON CONFLICT … DO UPDATE (PostgreSQL/SQLite), ON DUPLICATE KEY UPDATE (MySQL), or MERGE INTO (SQL Server) using the column you designate as the conflict key.
What extra features does this tool have versus others?
(1) RFC 4180-correct CSV parser (quotes, embedded commas/quotes/newlines, BOM, mixed line endings). (2) Delimiter auto-detect (comma/semicolon/tab/pipe). (3) Smart per-column type inference (int/decimal/boolean/date/text). (4) NULL vs empty-string handling with configurable token. (5) Three insert modes — single, batched, upsert. (6) Optional CREATE TABLE with typed columns. (7) Five-dialect support (ANSI/MySQL/PostgreSQL/SQLite/T-SQL). (8) Optional identifier quoting per dialect. (9) SQL-injection-safe string escaping. (10) Live preview with type badges. (11) localStorage history (max 20). (12) Shareable URL config. (13) Copy / download .sql. 100% offline — no upload.
Related tools
.bashrc / .zshrc Alias & Config Manager
Build shell aliases, functions, exports, and PATH edits in a visual editor, then export a clean, commented .aliases file sourced from both .bashrc and .zshrc — with shadowing detection against shell builtins and common CLI tools, function suggestions when args are needed, starter packs (git, docker, kubectl, navigation, safety, ls, dev, devops, data science), import of existing rc files, dedupe, history (localStorage), and shareable URL. 100% client-side.
Add / Subtract Date Calculator
Add or subtract years, months, weeks, days, hours, minutes and seconds from a starting date/time. Calendar-day or business-day mode with custom weekend + holiday list. Month-end policy toggle (clamp to last day vs overflow). Repeat/series mode (e.g. every 2 weeks x 10) with CSV export. Shareable URL. 100% client-side.
Age Calculator
Calculate exact age from a birth date in calendar years/months/days (no negative-day bugs) plus totals in months/weeks/days/hours/minutes/seconds. Next-birthday countdown with weekday. Feb-29 birthday policy toggle. Milestones (1,000 days, 10,000 days, 1 billion seconds). Zodiac sign + Chinese zodiac. Age gap comparison. Shareable URL. 100% client-side.