SQL Insert Generator
Turn CSV or JSON rows into CREATE TABLE and batched INSERT statements for PostgreSQL, MySQL, SQLite or SQL Server.
Runs in your browser. Files stay on this device.Built with Papa Parse (MIT)
How to use SQL Insert Generator
- 1Paste CSV or JSON rows, or drop a file.
- 2Pick your database and name the table.
- 3Copy the SQL or download it as a .sql file.
Questions
How are quotes and special characters handled?
Single quotes are doubled, the standard SQL way. For MySQL backslashes are doubled too, and SQL Server strings get the N prefix so accents and other scripts survive.
How are column types chosen?
From the values. A column of whole numbers becomes an integer, true or false a boolean, YYYY-MM-DD a date, and anything mixed becomes text. Numbers with leading zeros, like postcodes, stay text.
Why split the rows into batches?
Very long INSERT statements can hit size limits. SQL Server allows at most 1,000 rows in one statement, so batches there never go above that.
Is my data uploaded?
No. The file is read and converted in your browser.
Is it free?
Yes. No account, no watermark and no daily limit.
Related tools
- DeveloperBase64 EncoderEncode text or files to Base64 and decode it back, with URL-safe and data URL options.
- DeveloperDiff CheckerCompare two texts and see what was added and removed, line by line or word by word, and download a patch.
- DeveloperHash GeneratorGet the MD5, SHA-1, SHA-256, SHA-384 and SHA-512 of text or any file, and check it against a hash you were given.
- DeveloperJSON FormatterFormat, check and minify JSON, with the exact line of any error.
- DeveloperJWT DecoderRead the header and claims of a JSON Web Token, see when it expires, and check an HMAC signature.
- DeveloperRegex TesterTest JavaScript regular expressions live: every match highlighted, capture groups in a table, and a replace preview.