Nouplo

CSV to SQL

A pasted table, ready to run.

Output
Paste or type above to see the result here.

Your files stay on your device

This tool runs entirely in your browser. What you paste is processed on your device and is never sent to a server, so it is safe to use with tokens, keys and unpublished text.

How it works

  1. Paste the CSV or TSV — straight out of a spreadsheet works.
  2. Name the table. Quote the identifiers if your database needs it.
  3. Leave CREATE TABLE on for a new table; turn it off to insert into one you already have.
  4. Copy the SQL and run it. Read it first.

Frequently asked questions

How does it choose the column types?
By the narrowest type every value in the column fits: all digits gives INTEGER, a decimal point gives DECIMAL, a date gives DATE, and anything else gives VARCHAR sized with a little headroom. One piece of text is enough to make the whole column text, which is the safe direction to be wrong in.
Are the values escaped?
A quote inside a value is doubled, which is the escape every dialect agrees on, and an empty cell becomes NULL rather than an empty string. That is right for a file you are about to run yourself against your own data.
Can I use this on data from a form or an API?
Not safely. These are literals, not placeholders, so building statements this way from input you did not type is how SQL injection happens. For anything automated, use your driver’s parameters.
Why does it batch the rows?
One INSERT with a hundred rows runs far faster than a hundred INSERTs, and stays small enough to read. Drop it to one per statement if you need to run them individually.
Is anything sent to a server?
No. It runs in your browser, so what you paste stays on your computer.

Related tools