CSV or JSON input
Runs in your browser· your data is turned into SQL in this tab and never uploaded
Generate SQL from CSV and JSON in your browser
Load a CSV, a JSON array or JSON Lines and get a CREATE TABLE statement and batched INSERT statements for PostgreSQL, MySQL, SQLite, Snowflake or BigQuery. Column types are guessed from your data and can be changed, identifiers are quoted for the target database, and string values are escaped. The data never leaves your browser.
Frequently Asked Questions
- How do I convert a CSV file to SQL INSERT statements?
- Paste the CSV (with a header row) or open the file, pick your database and table name, and the page writes a CREATE TABLE statement and batched INSERT statements. Copy the SQL or download it as a .sql file. A JSON array of objects or JSON Lines works the same way.
- How are column types chosen?
- From the values: whole numbers become integers (or BIGINT above 15 digits), numbers with a decimal point become decimals, true and false become booleans, YYYY-MM-DD and ISO date-times become DATE and TIMESTAMP, and everything else is text. A value with a leading zero, like a ZIP code 02134, stays text so the zero is not lost. You can change any column's type before copying.
- Is the SQL safe to run? Are quotes escaped?
- Text values are written as single-quoted literals with every single quote doubled, and backslashes are doubled for MySQL and BigQuery, where they are escape characters. Table and column names are quoted for the chosen database. Still, read generated SQL before running it on a production database, and never build queries by pasting untrusted data into SQL by hand.
- Is my data uploaded anywhere?
- No. The CSV or JSON is read and converted in your browser tab; nothing is sent to a server or stored. Files up to 20 MB and 200,000 rows are accepted so the page stays responsive.
Related Tools
Found this useful? Hexabench is free and ad-free. If it saved you time, you can support it.
Buy me a coffee →