CSV, JSON & SQL Converter
Convert CSV into SQL INSERT statements, a JSON array or a Markdown table — and parse INSERT statements back into data. Column types are inferred from the values, identifier quoting and boolean literals follow the dialect you choose, and you can override any column’s type before generating.
- Price:
- Free, no sign-up
- Data:
- Processed locally
- Reviewed:
Interactive csv to sql
Input
Input DataDrop a CSV, JSON or SQL file
Or paste below — nothing is uploaded
Detected columns
Parameters & SettingsOverride any type before generating SQL
| id | name | signup_date | plan | mrr | active | |
|---|---|---|---|---|---|---|
| 1 | Rowan Ellis | rowan@example.com | 2026-01-14 | pro | 49.00 | true |
| 2 | Sam Okafor | sam@example.com | 2026-02-02 | team | 149.00 | true |
| 3 | Lena Hart | lena@example.com | 2026-02-19 | free | 0 | false |
| 4 | Ade Cole | ade@example.com | 2026-03-07 | pro | 49.00 | true |
Output
Results & OutputCREATE TABLE IF NOT EXISTS "customers" (
"id" BIGINT,
"name" TEXT,
"email" TEXT,
"signup_date" TIMESTAMP,
"plan" TEXT,
"mrr" NUMERIC,
"active" BOOLEAN
);
INSERT INTO "customers" ("id", "name", "email", "signup_date", "plan", "mrr", "active") VALUES
(1, 'Rowan Ellis', 'rowan@example.com', '2026-01-14', 'pro', 49.00, TRUE),
(2, 'Sam Okafor', 'sam@example.com', '2026-02-02', 'team', 149.00, TRUE),
(3, 'Lena Hart', 'lena@example.com', '2026-02-19', 'free', 0, FALSE),
(4, 'Ade Cole', 'ade@example.com', '2026-03-07', 'pro', 49.00, TRUE);How do I convert a CSV into SQL INSERT statements?
Paste or drop the CSV, check the detected column types, name the table and choose PostgreSQL, MySQL or SQLite. Rows are batched into multi-row INSERT statements, string values are escaped by doubling single quotes, and a matching CREATE TABLE can be generated alongside them.
How to use the csv to sql
- Paste or drop data: Drop a .csv file or paste CSV, JSON or SQL INSERT statements.
- Confirm the parse: The tool detects the delimiter, headers and column types — adjust if needed.
- Pick an output: Choose SQL, JSON, CSV or Markdown, and set the table name and dialect.
- Copy or download: Copy the result or download it as a file.
How the csv to sql works
Delimiters, quoting and the edge cases
CSV looks trivial and is not. The parser handles quoted fields containing the delimiter, escaped quotes doubled inside quoted fields, embedded newlines, and a UTF-8 byte order mark at the start of the file. Delimiter detection scores commas, semicolons, tabs and pipes by how consistently they split the first rows into equal-length records.
Type inference rules
- Integer — every value matches an optional sign and digits, within safe integer range.
- Decimal — digits with a single separator; scientific notation accepted.
- Boolean — the set true/false/yes/no/0/1/t/f case-insensitively, and nothing else.
- Date — ISO 8601 date or date-time; ambiguous regional formats are deliberately left as text.
- Text — the fallback, and the right answer for anything with a leading zero such as a postcode or phone number.
Batched inserts
One INSERT per row is simple and slow — each statement is a round trip and, in many engines, its own transaction. Multi-row inserts batch tuples into a single statement, typically an order of magnitude faster for bulk loads. The batch size is capped so statements stay inside parameter and packet limits.
CSV to SQL — frequently asked questions
Every value in a column is tested against integer, decimal, boolean, ISO date and null patterns. A column is typed only if all its non-empty values agree; a single stray value demotes it to text. You can override any column manually before generating SQL.
String values are escaped by doubling single quotes, the standard SQL escape, and identifiers are quoted per dialect. That said, always review generated DDL and DML before running it against anything that matters — the tool cannot know your constraints or charset.
PostgreSQL, MySQL and SQLite. They differ in identifier quoting (double quotes vs backticks), boolean literals (TRUE vs 1) and multi-row insert syntax, all of which the generator handles.
Yes — paste INSERT statements and the parser extracts the column list and value tuples, handling quoted strings, escaped quotes, NULLs and numeric literals, then gives you the data as CSV or JSON.
Official resources & government references
Verified references, primary standards specifications, and official publications governing the rules and calculations implemented in this tool:
RFC 4180: Common Format and MIME Type for CSV Files
The formal Internet standard for comma-separated values, field quoting, and record delimiters.
SQLite SQL Language Grammar & DDL Syntax
Authoritative documentation on SQLite syntax, dynamic typing, and multi-row INSERT syntax.
PostgreSQL SQL Language Reference
Official manual covering PostgreSQL table definition, COPY semantics, and data typing.
Important Disclaimer
SQL DDL schemas and INSERT queries are generated via client-side heuristics. Always review column types, foreign key constraints, and character encoding in an isolated test environment before running scripts in production databases.