go-supertools
Developer & Data Tools

SQL INSERT Generator

Turn CSV or JSON into CREATE TABLE and INSERT statements for PostgreSQL, MySQL, SQLite or SQL Server.

Runs in your browser Your input never leaves your device.

Column types are guessed from the data (numbers, true/false, dates; values like 007 or +30… stay text). Every value is written as an escaped literal, and line breaks are written as escapes so the file survives editors that change line endings. MySQL output assumes the default mode where backslash is an escape character. Check the types before using the SQL on real data. The SQL is only generated here, never run.

Report a problem with this tool

About this tool

Paste CSV, tab-separated cells from a spreadsheet, or a JSON array of objects, choose your database and table name, and the tool writes the SQL to load it. It guesses a type for each column from the data: integers (INTEGER or BIGINT), decimals, true/false, dates and timestamps; anything else, including codes like 007 and phone numbers such as +3069…, is kept as text so nothing is changed. Empty cells can become NULL. Every value is written as a correctly escaped literal for the chosen database: doubled quotes everywhere, backslash handling for MySQL and PostgreSQL, N-prefixed strings for SQL Server, and line breaks written as escapes so the file is not damaged if an editor changes line endings. Rows are grouped into INSERT statements of the size you choose (SQL Server allows at most 1000). The output was executed on real SQLite, MySQL and PostgreSQL servers and the values read back identical, including awkward strings with quotes, backslashes, line breaks and emoji; SQL Server output follows its documented syntax but was not run on a server. The SQL is only generated in your browser, never executed or uploaded. Check the guessed types before using it on real data.

How to use it

  1. Paste CSV, spreadsheet cells or a JSON array.
  2. Choose the database, the table name and the batch size.
  3. Check the guessed column types in the list.
  4. Press Copy SQL or Download .sql and run it in your database tool.

Common problems

A column became text but I wanted a number
One value is not a plain number (for example 1,200, $5 or a blank-looking cell with spaces). Clean that value, or change the column type in the CREATE TABLE statement.
MySQL stores my backslashes wrongly
The output assumes the default MySQL mode where backslash is an escape character. If your server uses NO_BACKSLASH_ESCAPES, change that setting or double-check values containing backslashes.
The file is too large
The limit is 50,000 rows and about 5 MB of SQL. For bigger loads use your database's bulk import (COPY, LOAD DATA, .import) instead of INSERT statements.