CSV → SQLite

Convert CSV to SQLite SQL

Drop a CSV and get a ready-to-run CREATE TABLE + INSERT script for SQLite — with proper type affinity and editable schema. Runs in your browser, nothing uploaded or installed.

Drop or choose your file to start...
Choose a file...

SQLite-ready output

CREATE TABLE + INSERT statements that load straight into a SQLite database.

Type-affinity aware

Maps your data to INTEGER, REAL, and TEXT — SQLite's storage classes.

No install needed

Build the SQL in your browser; run it with the sqlite3 CLI or DB Browser.

Big files welcome

INSERTs are batched so large imports stay fast and reliable.

Schema control

Override inferred types, rename columns, and set a primary key.

Private by design

Processed in memory, in your browser, never stored.

How to convert a CSV file to SQLite

SQLite is a local, file-based database — which makes it a natural fit for SQLified, since both run without a server. Drop your CSV and SQLified writes a CREATE TABLE + INSERT script with sensible column types, ready to run against a new or existing .db file.

  1. Drop your CSV onto the converter above (or click to choose a file).
  2. Review the schema. SQLified infers SQLite type affinity. Adjust any type, mark columns nullable, rename them, or set a primary key.
  3. Generate the SQL — a CREATE TABLE plus batched INSERT statements.
  4. Run it with sqlite3 mydb.db < script.sql or paste it into DB Browser for SQLite.

What the generated SQL looks like

CREATE TABLE IF NOT EXISTS "users" (
  "id" INTEGER NOT NULL,
  "name" TEXT NOT NULL,
  "signup_date" DATE NOT NULL,
  "amount" REAL NOT NULL
);

INSERT INTO "users" ("id", "name", "signup_date", "amount") VALUES
('1', 'Ada Lovelace', '2026-01-04', '120.50'),
('2', 'Alan Turing', '2026-02-11', '99.00');

Identifiers are double-quoted, and CREATE TABLE IF NOT EXISTS means the script is safe to re-run.

SQLite type affinity

Unlike most databases, SQLite doesn't enforce rigid column types — it uses type affinity, a preferred storage class per column. SQLified maps your data accordingly:

  • Whole numbers → INTEGER.
  • Decimals → REAL.
  • Dates → DATE / DATETIME (stored as text, which SQLite handles natively).
  • Everything else → TEXT.

This beats a plain .import, which would otherwise store every column as text.

Frequently asked questions

Does SQLified upload my CSV?

No. Everything runs in your browser — the file is read into memory, converted to SQL, and never sent anywhere. Perfect for SQLite, which is itself a local, file-based database.

How is this different from sqlite3's .import?

The .import command in the sqlite3 CLI reads a CSV directly, but it imports every column as TEXT unless the table already exists with proper types. SQLified generates a CREATE TABLE with real type affinity plus INSERTs, so your numbers and dates land in the right storage classes from the start.

What types does SQLite use?

SQLite uses type affinity rather than strict types: numbers map to INTEGER or REAL, and everything else to TEXT. SQLified picks the right affinity per column, and you can override any of them.

Can it handle large CSV files?

Yes — SQLified handles millions of rows, and the INSERT output is batched (1,000 rows per statement) so even big files import smoothly via the CLI or a GUI tool.

How do I run the generated script?

Save it as a .sql file and run sqlite3 mydb.db < script.sql, or paste it into DB Browser for SQLite. No server or setup required.