Nothing you open here is ever uploaded

Turn a CSV into SQL INSERT statements

Paste a CSV, name the table, and get INSERT statements you can paste into a database client. Two decisions are made carefully. A value with a leading zero — a postcode, a product code, a phone number — is written as text, because turning 0123 into 123 loses a digit and nothing on screen says so. And apostrophes inside values are doubled, which is what SQL requires and what keeps a name like O’Brien from breaking the statement.

This page loads no libraries at all — the work is done by the browser itself. Your file is read on your own machine and never sent anywhere — open your browser's network tab and watch while you use it.

Questions

Why is 0123 quoted but 123 is not?

Because the leading zero is information. Postcodes, product codes, account numbers and phone numbers routinely start with zero, and writing them as numbers deletes that digit permanently. The rule here is simple and visible: a value is treated as a number only if it has no leading zero, so 123 and -4.5 go in bare while 0123 goes in quoted.

What happens to quotes and apostrophes in the data?

Single quotes are doubled, which is how SQL escapes them, so it’s fine becomes ’it’’s fine’. Without that the statement ends early and either fails or, in the worst case, executes something you did not intend. The table and column names are checked separately and rejected outright if they are not plain identifiers.

What do empty cells become?

NULL rather than an empty string. The two mean different things in a database — unknown versus known-to-be-blank — and a CSV cannot tell them apart, so the choice has to be stated. If you need empty strings instead, a find and replace on the output is a two-second job.

Can I get one statement per row?

Yes. The default is a single multi-row INSERT, which is much faster to run and is what you want for a bulk load. Switch it and you get one statement per row, which is easier to run selectively or to trim by hand when a few rows fail.

Other data & spreadsheets tools

Everything here is free and works the same way — in your browser.