sitekits.dev
press ⌘K to switch tools
FORMAT & CONVERT

CSV to SQL Converter

Generate SQL INSERT statements from CSV data.

local
csv-sql

Identifiers and values are quoted for the selected dialect. Backslashes are escape characters in MySQL but literal in standard SQL, so picking the wrong dialect can corrupt data — review the output before running it.

§01 ABOUT THIS TOOL

Overview

This tool converts CSV data into one INSERT statement per row — useful for seeding a development database, migrating a spreadsheet export, or building test fixtures without writing a script. Column names come from the CSV header (or are auto-named col1, col2, … when there is no header).

How to use

  1. Set the target table name in the Table field.
  2. Check First row is header if your CSV’s first line contains column names; uncheck it to treat every line as data.
  3. Paste your data into the CSV area — the SQL output regenerates as you type.

Examples

  • Input id,name,active / 1,Alice,trueINSERT INTO `my_table` (`id`, `name`, `active`) VALUES (1, 'Alice', 'true');
  • A field like O'Brien is escaped to 'O''Brien'; an empty field becomes NULL.

Notes

The generator emits INSERT statements only — create the table yourself first. Booleans like true/false are treated as strings, and numbers are detected by pattern (-?digits[.digits]), so review the output before running it against a real schema.

FAQ
Is my CSV data uploaded anywhere?
No. Parsing and SQL generation happen entirely in your browser. Nothing is sent to a server, so the tool is safe for internal or confidential datasets.
How are values quoted in the generated SQL?
Purely numeric values (integers and decimals) are emitted unquoted, empty fields become NULL, and everything else is wrapped in single quotes with embedded quotes escaped by doubling them.
Which SQL dialect does the output target?
Table and column identifiers are wrapped in backticks, which is MySQL/MariaDB syntax. For PostgreSQL or SQL Server, replace the backticks with double quotes or square brackets.