Developer Utilities

CSV to SQL

All tools

Paste a spreadsheet export and get a table definition plus INSERT statements you can run.

How it works

Four simple steps

1

Paste CSV data

Include a header row for cleaner column names.

2

Choose SQL dialect

Generate Postgres, MySQL, or SQLite-friendly statements.

3

Infer types & build SQL

Create TABLE plus batched INSERTs with NULL handling.

4

Copy or download

Run the script in your database client or migration tool.

CSV to SQL

About CSV to SQL

Product sends over a CSV of 4,000 customer records and wants them in a staging database by this afternoon. Writing the CREATE TABLE by hand means guessing which columns are dates and which are numbers. CSV to SQL reads the data, makes those guesses for you, and shows how confident it was about each one.

Paste CSV or load the sample, pick PostgreSQL, MySQL or SQLite, and name the table. The delimiter (comma, semicolon, tab or pipe) is detected automatically or can be forced. Each column is typed as integer, bigint, float, boolean, date, timestamp or text, and text columns get a VARCHAR sized from the longest value plus some headroom, switching to TEXT past 255 characters. Options cover the header row, CREATE TABLE, DROP TABLE IF EXISTS, a transaction wrapper, snake_case column names, an auto-increment id key, and the INSERT batch size (100 rows by default, up to 5,000).

Read the type inference report before running anything. A column where only 95 percent of values parse as numbers still gets a numeric type, and the odd values are written as quoted strings, so a strict database will reject that INSERT. Thousands separators and currency symbols are the usual culprits. Empty cells and tokens like NULL, NA, N/A and \N become SQL NULL. To reshape the data first, convert the CSV to JSON, or tidy the generated script with the SQL formatter.

Parsing and SQL generation happen in the page itself, so customer rows never leave your machine. The flip side is that very large files are limited by browser memory rather than an upload cap.

Keyboard shortcut

Ctrl Enter - Run tool
FAQ

Frequently asked questions

See all FAQs

Answers for this tool. For site-wide help, open the FAQ hub.

Single quotes are doubled in every dialect. For MySQL, backslashes are escaped as well because MySQL treats them as escape characters by default. Identifiers are wrapped in double quotes for PostgreSQL and SQLite and in backticks for MySQL.

They are padded with empty values or trimmed to the header width, and a warning says how many rows were affected. That usually points to an unquoted comma or a line break inside a field.

SQLite has no dedicated date or timestamp type, so dates are stored as TEXT, booleans as INTEGER 1 or 0, and floats as REAL. PostgreSQL and MySQL get native DATE, TIMESTAMP or DATETIME columns instead.

View more FAQs

Related tools

View all

Cron Calendar

Explain cron expressions and preview the next run times in any timezone.

Open

SQL Query Builder

Build SELECT queries visually and reverse-parse SQL into a structure tree.

Open

Log Pattern Miner

Cluster log lines into templates, surface anomalies, and mask PII locally.

Open

MongoDB Query Builder

Build find/aggregate pipelines visually and export mongosh snippets.

Open

Explore 321 free tools

Everything you need as a developer, marketer or creator - in one beautiful place.

Browse all tools