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
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 or a JSON array of flat objects. For CSV, check the separator and whether the first row contains headers.
  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. Choose Number, Boolean or a date type only when it matches the receiving table and 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?

Text protects identifiers and leading zeros. Number, Boolean, Date and Date and time are explicit choices. Date and time with offset keeps zones. Temporal choices validate ISO values and add missing seconds without rounding fractions; Text keeps the original spelling. Invalid cells are reported by row and column.

How are empty strings and null handled?

JSON null and missing properties become SQL NULL. Empty or whitespace-only text becomes NULL only when Treat empty text as NULL is selected. A separate option treats NULL, N/A and - as NULL. Other values stay literal. Boolean columns accept true/false, yes/no or 1/0.

Which input structures are supported?

CSV needs equally sized rows. Headers must be unique names; turn off CSV has a header row to use Column 1, Column 2 names. Interior blanks remain records in single-column CSV; skipped blank lines in wider tables are reported. Errors refer to physical CSV lines. JSON needs flat objects, not nested values. Up to 100 columns and 250,000 cells are supported.

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.