SQLRep

CSV to SQL converter

Turn a CSV into a CREATE TABLE with the right column types, plus INSERT statements for every row. Ready to paste into PostgreSQL.

Runs in your browser. Your data is never uploaded.

Questions

Is my data uploaded anywhere?
No. The file is read by PostgreSQL running inside your browser tab, and the SQL is generated there too. Nothing is sent to a server, so it's fine for work data.
How are column types chosen?
Each column gets the first type every non-empty value fits: bigint for whole numbers, numeric for decimals, date for YYYY-MM-DD, timestamp for date and time, boolean for true/false. Anything else, like $1,200 or 01/02/2026, stays text so no value is lost. Empty cells become NULL.
What happens to column names?
They're turned into names you can type without quotes: lowercase, spaces and symbols become underscores, so "Order Date" becomes order_date. Names that are SQL keywords get an underscore added, so order becomes order_.
Does it work for MySQL or SQLite?
The script is written for PostgreSQL. It uses standard types and quoting, so it often runs elsewhere with small changes, but test it before relying on that.
How big a file can I convert?
Up to 25 MB. INSERTs are grouped 1,000 rows at a time so the script stays quick to run. For much bigger files, PostgreSQL's COPY command is the better tool.

Want to get faster at the queries you'll run on this data? SQLRep's drills take you from SELECT to window functions in real PostgreSQL, with the first 27 free.