SQL generator

Turn CSV or JSON rows into SQL INSERT statements, with column types you control.

FreeNo pass requiredNo ads

Your text and files stay in your browser.

Drop a file here, or use Open file. Ctrl+Enter / Command+Enter runs the tool.

Ready for your input
Processed on your device

Paste text or try an example to begin.

No uploads. No ads. No Data Pass required. Buy me a coffee

Make reference data ready for your database

Turn a CSV export or a JSON array of flat objects into SQL INSERT statements for an existing table. Choose SQL Server, PostgreSQL, or SQLite, then review the column names, first values, and value types beside the output. Text is the starting type so postal codes, identifiers, and long numbers are not changed by automatic guessing. The generator creates a script locally. It never connects to a database, requests credentials, or executes the result.

SQL generation examples

Keep a ZIP code as text

Input

name,zip
Avery,00123

Result

INSERT INTO [people] ([name], [zip])
VALUES
  (N'Avery', N'00123');

SQL Server uses Unicode string literals. Keeping the ZIP column as Text preserves its leading zeros in the generated statement; the receiving table must also use a suitable text column.

Quote an apostrophe correctly

Input

[{"name":"O'Brien"}]

Result

INSERT INTO "people" ("name")
VALUES
  (E'O''Brien');

PostgreSQL output quotes identifiers and escapes string content. The generated statement stores the apostrophe as part of the value. Input is never inserted into the script as an executable expression.

How to generate an INSERT script

  1. Paste CSV with column headers or a JSON array of flat objects. Choose the input format and, for CSV, check the separator.
  2. Choose the target database, table name, and optional schema. Names are quoted for that database; schema and table are entered separately.
  3. Generate the first result, then review each column. Change a value type to Number or Boolean only when it matches the receiving table and the source data.
  4. Choose row batching and empty-text handling. Review the script before copying or downloading it, and test imports against an appropriate database before using production data.

SQL generator questions

Does the tool run SQL or contact my database?

No. It only generates text in the browser. You decide where and whether to execute that text. The target table must already exist, and its types and constraints still determine whether an insert will succeed.

Why do all columns start as Text?

Automatic typing can remove leading zeros or change identifiers. Text preserves the supplied values. Number and Boolean are explicit choices, with invalid cells reported by row and column. JSON numbers keep their written precision even before you choose a type.

How are empty strings and null handled?

JSON null and missing properties become SQL NULL. Empty text stays an empty string unless Treat empty text as NULL is selected. This distinction matters because null and an empty string can have different meanings in an application.

Which input structures are supported?

CSV needs unique named headers and equally sized rows. Interior blanks remain empty records in single-column CSV; skipped blank lines in wider tables are reported. Errors refer to physical CSV lines. JSON needs a nonempty array of flat objects; nested values require a mapping first. Up to 100 columns and 250,000 cells are supported, alongside the shared input and output limits.

Review against the receiving table

This tool generates INSERT statements, not migrations, UPDATE or DELETE commands, or CREATE TABLE definitions. It cannot validate database permissions, constraints, numeric precision, or existing records. SQLite does not use the Schema field here. Names differing only by case are rejected to avoid collisions in databases with case-insensitive identifiers.