CSV to SQL INSERT Generator

Paste a CSV, TSV, or pipe-delimited file and get a multi-row INSERT INTO … statement back. Pick the dialect (PostgreSQL, MySQL, SQLite, or SQL Server), the delimiter, whether the first row is a header, and the batch size. Optional type inference turns "42" into 42, "true" into TRUE, and a configurable token (default NULL) into a real SQL NULL. Live preview, copy and download — pure client-side, no upload.

Options — table, dialect, delimiter, type rules
Summary — recomputed live
Status awaiting input
Rows 0 0 statements
Columns 0 first: —
Output 0 chars
SQL
Paste a CSV above to see the INSERT statement.
How the generator works
  • Header row — when on, the first line becomes the column list (e.g. id, name, role); when off, columns are auto-named column_1, column_2, ….
  • Delimiter — comma, semicolon, tab, or pipe. Quoted fields follow RFC 4180 (doubled quotes, embedded newlines).
  • Dialect — identifier quoting follows the dialect: "…" for PostgreSQL/SQLite, \`…\` for MySQL, […] for SQL Server. Boolean literals become TRUE/FALSE except in MySQL and SQL Server, which use 1/0.
  • Type inference — numbers (strict format: optional sign, integer / decimal, optional scientific notation) and the literal strings true / false are emitted unquoted. Leading-zero IDs (00123) stay as strings.
  • Empty → NULL — if on, a blank cell becomes NULL; otherwise it becomes ''.
  • Null token — any cell whose value (case-insensitive) matches this string becomes NULL. Default NULL; set to a different token (e.g. \N) or blank to disable.
  • Batch size — rows per INSERT statement, clamped to 1–1000. 100 is a comfortable default for most clients.
  • Schema-qualified tables — typing public.people quotes each segment separately: "public"."people".
  • Errors — duplicate headers, blank headers, ragged rows (with the offending one-based CSV line number), and a missing table name are surfaced instead of emitting ambiguous SQL.
  • Everything runs locally. Nothing leaves the browser.