Guide

THE TOOLBOX / DATA & SERIALIZATION UTILITIES

Convert CSV to SQL
with schema inference.

Transform CSV spreadsheets into production-ready SQL DDL and INSERT statements locally in your browser. Target PostgreSQL, MySQL, or SQLite with type inference, NULL detection, and multi-row batching.

Presets:
5 lines · 267 B
●   Live RFC 4180 parser

267 / 500,000 UTF-16 code units · 267 UTF-8 bytes

Live SQL ready: 4 rows × 7 columns (POSTGRES).

POSTGRES2 stmt · 617 B
Inferred Schema (7 columns)
id: INTEGERfull_name: VARCHAR(32)email: VARCHAR(32) (null)age: INTEGERbalance: NUMERIC(12, 2) (null)is_active: BOOLEANsignup_date: DATE

THE DETAILS

Client-side CSV parsing, type deduction, and multi-dialect SQL generation.

1. Step-by-Step Workflow

Paste raw comma-separated values or open a local .csv file, designate your target table name, select your database dialect (PostgreSQL, MySQL, SQLite, or Standard ANSI), configure schema options, and click Generate SQL. Copy the resulting script or download [table]-[dialect].sql directly.

2. RFC 4180 Parsing & Character Limits

The workspace strictly adheres to RFC 4180, properly escaping commas, double-quote delimiters (""), and newlines inside quoted fields. The browser-first parser supports datasets up to 500,000 characters, 5,000 rows, and 100 columns entirely in memory.

3. Intelligent Schema & Type Deduction

Enabling Infer data types scans every row to deduce optimal column data types: INTEGER for integers, NUMERIC / REAL for floating-point values, BOOLEAN for flags, and DATE / TIMESTAMPTZ for calendar timestamps. Any column with missing values is marked nullable.

4. Zero-Data-Egress Security & Related Tools

Enterprise CSV exports often contain customer PII, internal prices, and proprietary financials. This tool operates 100% client-side with zero telemetry. Need to inspect or format SQL? Query your database in the SQLite Database Viewer, clean queries in the SQL Formatter, or convert DDL to ORMs in the SQL to Prisma & Drizzle Converter.

SQL Dialect Syntax & Feature Comparison

Feature / TypePostgreSQLMySQLSQLiteStandard ANSI
Identifier Quote"table"`table`"table""table"
Auto Primary KeySERIAL PRIMARY KEYINT AUTO_INCREMENT PRIMARY KEYINTEGER PRIMARY KEY AUTOINCREMENTINTEGER PRIMARY KEY
Decimal NumbersNUMERIC(12, 2)DECIMAL(12, 2)REALNUMERIC(12, 2)
TimestampsTIMESTAMPTZDATETIMETEXT (ISO 8601)TIMESTAMP
Batch InsertVALUES (...), (...)VALUES (...), (...)VALUES (...), (...)VALUES (...), (...)

Frequently Asked Questions

Does this CSV to SQL converter upload my spreadsheet data to a server?

No. All CSV parsing, column type inference, schema DDL generation, and SQL statement formatting execute 100% locally in your browser memory via client-side JavaScript. Zero rows, columns, or values are ever transmitted over the network.

How does automatic data type inference detect integers, decimals, booleans, and dates?

The engine inspects every cell in each column. Columns containing whole numbers without exponents become INTEGER (or BIGINT); floating-point numbers become NUMERIC/DECIMAL or REAL; true/false or t/f values become BOOLEAN; ISO 8601 strings become DATE or TIMESTAMPTZ/DATETIME; and mixed or textual entries become VARCHAR or TEXT.

How are NULL values and empty CSV cells handled?

When type inference is enabled, empty cells ("") or cells containing case-insensitive "null" are emitted as unquoted SQL NULL literals and mark the column as nullable in the generated CREATE TABLE statement. When disabled, all values are quoted as SQL string literals.

What are the key dialect differences between PostgreSQL, MySQL, and SQLite outputs?

PostgreSQL uses double-quoted identifiers ("table"), SERIAL primary keys, and TIMESTAMPTZ. MySQL uses backticks (`table`), INT AUTO_INCREMENT PRIMARY KEY, and DATETIME. SQLite uses double quotes, INTEGER PRIMARY KEY AUTOINCREMENT, and REAL types. Standard ANSI SQL uses double quotes and ANSI standard types.

What is the advantage of multi-row batch INSERT statements?

Standard single-row INSERT statements require separate round-trips or transaction overhead for each row. Multi-row batch inserts combine up to 500 records into a single "INSERT INTO table VALUES (...), (...);" statement, reducing database write time by up to 80% during bulk data seeding.