CSV to SQL Converter

Paste a CSV file, or open one, and get INSERT statements ready to run, with a CREATE TABLE that has column types worked out from your data. Pick PostgreSQL, MySQL, SQLite or SQL Server and the quoting, booleans and types follow that database. Your data stays in your browser.

Input
Database

1 writes one statement per row.

3 rows in 1 INSERT. Columns: id INTEGER, name TEXT, city TEXT, phone TEXT, amount NUMERIC, paid BOOLEAN, order_date DATE

SQL generation runs in your browser. What you type never leaves this device.

Features

  • Reads comma, tab and semicolon separated files, quoted fields and line breaks inside quotes

  • CREATE TABLE with INTEGER, BIGINT, DECIMAL, BOOLEAN, DATE, TIMESTAMP or text types guessed from every row

  • Keeps values like 09876543210, PIN codes with leading zeros and long account numbers as text, so no digits are lost

  • Multi-row INSERTs in batches you choose, or one statement per row

  • Escapes quotes in names like D'Souza, and empty cells can become NULL

  • Download as a .sql file or copy it into your SQL client

Typical jobs

Loading an Excel sheet into a database

Save the sheet as CSV from Excel or Google Sheets, paste it here and run the SQL in pgAdmin, MySQL Workbench, DBeaver or the sqlite3 shell.

Seeding a development database

Turn a small CSV of sample customers or products into a seed.sql file that lives next to your migrations.

Moving data when you lack import rights

On shared hosting or a locked-down server, LOAD DATA and COPY may be blocked. Plain INSERT statements run anywhere you can run a query.

Getting a clean import

How column types are chosen

  • Whole numbers become INTEGER, or BIGINT above 2,147,483,647.
  • Numbers with a decimal point become DECIMAL (NUMERIC in PostgreSQL, REAL in SQLite).
  • true and false become BOOLEAN (BIT in SQL Server, INTEGER in SQLite).
  • 2026-11-02 becomes DATE, and 2026-11-02T10:30:00 becomes TIMESTAMP.
  • Anything else, or a column that mixes kinds, stays text. Numbers with a leading zero or more than 15 digits also stay text.

Before you run it

  • Check the table name and the CREATE TABLE types, then add a PRIMARY KEY and NOT NULL where you need them.
  • Turn on Wrap in a transaction so a failure part-way leaves the table unchanged.
  • Dates must be in YYYY-MM-DD form to be detected. Change 02/11/2026 style dates in your sheet first, since day and month order is ambiguous.

Large files

Everything runs in your browser, so a few hundred thousand rows works on most laptops. For millions of rows, the database's own loader (COPY in PostgreSQL, LOAD DATA in MySQL, BULK INSERT in SQL Server) is much faster.

CSV to SQL Converter - FAQ