Docelora
ToolsAboutContact
Developer tools

CSV to SQL

Generate SQL to load a CSV file into a database: a CREATE TABLE statement with inferred column types and INSERT statements quoted correctly for MySQL, PostgreSQL, SQLite or SQL Server.

Quick answer: paste CSV or open a file, enter a table name and choose your database. Column types are guessed from the values (integer, decimal, boolean or text), empty cells become NULL, and quotes inside values are escaped.

CSV to SQL

MySQL · PostgreSQL · SQLite · SQL Server

Runs on your device: everything you type or open is processed in this browser tab. Nothing is uploaded to Docelora or anyone else.

Type inference

Values in a columnMySQLPostgreSQLSQLiteSQL Server
Whole numbersBIGINTINTEGERINTEGERBIGINT
DecimalsDECIMAL(18,6)NUMERICREALDECIMAL(18,6)
true / falseBOOLEANBOOLEANBOOLEANBIT
TextVARCHAR(255) / TEXTTEXTTEXTNVARCHAR(255) / MAX

Review the CREATE TABLE before running it – add primary keys, NOT NULL constraints and indexes as your schema needs. For very large files your database’s bulk loader (LOAD DATA, COPY, .import, BULK INSERT) is faster.

Related tools

Frequently asked questions

Which databases are supported?

MySQL/MariaDB, PostgreSQL, SQLite and SQL Server.

How are identifiers quoted?

Backticks for MySQL, double quotes for PostgreSQL/SQLite, brackets for SQL Server.

How are empty cells handled?

As NULL.

Are quotes in values escaped?

Yes – single quotes are doubled.

Are types always right?

They are inferred from the data – check them, especially for codes like phone numbers.

Why are leading-zero codes text?

They are not, unless non-numeric; change the type if you need to keep zeros.

What is multi-row INSERT?

One statement with up to 500 rows – much faster to run.

Does it add a primary key?

No – add one in the CREATE TABLE.

Are dates detected?

No – dates are treated as text; change the column type if needed.

Is SQL Server Unicode used?

Yes – N'…' strings and NVARCHAR.

Can I convert JSON instead?

Use JSON to SQL.

Is it safe for untrusted data?

Values are escaped, but review generated SQL before running it on production.

Large files?

Tens of thousands of rows work; use bulk loaders for millions.

Can I format the SQL?

Use SQL Formatter.

Is my data uploaded?

No.

Is my code uploaded?

No – it is processed in your browser and never leaves your device.

Is it free?

Yes, with no sign-up or limits.

Can I open a file?

Yes – use “Open file”, or paste the code.

Does it work offline?

Once the page and its library have loaded, yes.

Can I copy or download the result?

Copy it with one click, or download where offered.

Last reviewed: 8 November 2026.