{ }jsonkit
Format
Validate
Convert
Query
Generate

CSV to SQL generator

Infer a table definition and parameterized INSERT examples.
Dialect
▦Target table name
143 B · paste or drop a file
1 2 3
✓ complete143 B → 541 B0.0 ms

About CSV → SQL

The CSV to SQL converter turns a header and data rows into a CREATE TABLE statement plus parameterized INSERT statements for PostgreSQL, MySQL or SQLite.

How it works

Cautious type inference

Each column is typed from all its non-empty values as integer, number, boolean, date, timestamp or text. A column with mixed values stays text, so one odd value is not forced into a wrong type.

Dialect-aware definitions

Identifiers are normalized and quoted for the selected database. Inferred types map to the matching PostgreSQL, MySQL or SQLite column types.

Parameterized inserts

INSERT statements contain only placeholders. The cell values go in a JSON parameter comment next to each one. Pass both to your database driver's prepared statement API.

Frequently asked questions

Can I run the generated INSERT statements directly?

Not as-is, because they use placeholders. Pass each statement and its parameter array to your driver's prepared statement API.

Are empty cells NULL?

Yes, when the option is on. Otherwise they stay empty strings.

Does this connect to my database?

No. It only generates text in your browser.

Sources & last verified

We checked this tool's behavior and the claims on this page against the specifications below on . The tool runs in your browser, so the output you see is exactly what the engine produced.

Found a wrong result or an outdated claim? Report an error and we will check it again.