Skip to the tool
ViewCSV
Files stay on your device

Convert CSV to SQLite

orders.csv· SAMPLE DATA15 rows · 8 columns
Value types
Text keeps every value exactly. Detection uses INTEGER and REAL where every value fits.
orders.csv
#order_idcustomercityproductquantityunit_priceorder_datestatus
1001041Liam GarciaAustinDesk lamp6142.722026-01-09paid
2001042Mary ClarkSeattleMonitor 27"5210.762026-02-03shipped
3001043Henry TaylorDenverNotebook A51143.742026-03-25pending
4001044Lucas SmithChicagoMonitor 27"5137.002026-04-25shipped
5001045Noah DavisSeattleUSB-C cable7·2026-05-11refunded
6001046Emma WilliamsPortlandNotebook A56166.442026-06-10pending
7001047 Henry Taylor New YorkMonitor 27"757.532026-07-14pending
8001048Lucas JonesAustinDesk lamp7194.192026-08-03pending
9001049Olivia WilliamsAustinUSB-C cable5190.032026-09-07pending
10001050Mary WilsonNew YorkChair, ergonomic861.042026-01-15pending
11001051Noah WilliamsPortlandChair, ergonomic261.372026-02-25refunded
12001052Mia SmithBostonMonitor 27"5231.422026-03-09refunded
13001053Ava GarciaBostonUSB-C cable3201.242026-04-05pending
14001054Mary ClarkBostonDesk lamp535.492026-05-12pending
15001043Henry TaylorDenverNotebook A51143.742026-03-25pending

15 rows · 1 file Uses the SQLite engine (WebAssembly), downloaded once from assets.viewcsv.app. Your data stays in this tab.

Open or paste a CSV file, check the Table name, and select Download SQLite. You get a .sqlite database file with one table holding every row, ready for the sqlite3 shell, DB Browser for SQLite, Python or any SQLite library. By default every column is TEXT, so 000417 stays 000417. The SQLite engine runs as WebAssembly in your browser; the CSV is never uploaded.

How to convert CSV to SQLite

  1. Open a .csv, .tsv or .txt file, drop it on the tool, or paste rows. Check the table under Input; set the delimiter, header row or encoding under Import settings if needed.
  2. Check the Table name. It starts as the file name with spaces and punctuation turned into underscores, so orders 2026.csv becomes orders_2026.
  3. Choose Value types, an optional Primary key, and whether to Write empty cells as NULL.
  4. Select Download SQLite, then open the file, for example with sqlite3 orders.sqlite and SELECT * FROM orders LIMIT 10;.

The first conversion downloads the SQLite engine (sql.js, compiled to WebAssembly) once from assets.viewcsv.app. If that download fails, the tool shows an error and you can try again; your file stays on this device.

To convert many files with the same settings, choose Batch: convert several files. Each file becomes its own database, with a table named after that file, and they download together as one ZIP. In a batch, each file must be 25 MB or smaller.

What the database contains

One table, created with CREATE TABLE "name" (…), with one column per CSV column in the original order and all rows inserted in a single transaction. There are no extra indexes, views or ID columns.

Table and column namesUsed exactly as written and double-quoted, so spaces, punctuation, reserved words and non-Latin names work: query them as "order date". A blank header becomes Column 3 and a repeated one becomes name (2).
Keep every value as textThe default. Every column is declared TEXT and stores each value exactly as written.
Detect numbers and true/falseA column whose non-empty values are all whole numbers without leading zeros becomes INTEGER; decimals with at most 15 significant digits become REAL; true/false columns become INTEGER holding 1 and 0, because SQLite has no boolean type. Dates and everything else stay TEXT.
Primary keyOptional. The chosen column is declared PRIMARY KEY. Its values must be unique and not empty, or the tool stops before writing the file. A detected whole-number key becomes INTEGER PRIMARY KEY, SQLite's rowid alias.
Write empty cells as NULLOn by default. Turn it off to store empty cells as the empty string ''.

Line breaks, quotes and commas inside quoted CSV values are stored inside the value unchanged.

Troubleshooting

  • The conversion stops at the primary key. The chosen column has an empty or repeated value. Find duplicates with Validate CSV or the CSV viewer, choose another column, or set Primary key to None.
  • The engine could not be downloaded. The SQLite WebAssembly file comes from assets.viewcsv.app. Check your connection, firewall or content blocker, then try again.
  • `SUM()` treats a column as text. The column is TEXT. Convert again with Detect numbers and true/false; if it still stays text, one value isn't a plain number (1,234, 12 kg, 007). Or cast it in SQL: CAST(total AS REAL).
  • The file is too large for this tool. SQLite conversion works on files up to 25 MB, 100,000 rows, 250 columns and 2 million cells. For a bigger file, generate a script with CSV to SQL, which streams large files, and run it with sqlite3.

Limits and privacy

The CSV must open in the browser workspace: up to 25 MB, 100,000 rows, 250 columns and 2 million cells. The database is built in memory and exported as one file.

The engine runs in a background worker in this tab, so the page stays responsive and Cancel stops it. Only the engine file is downloaded; the CSV and the database never leave your device.

Example

An orders file with leading-zero IDs, an empty date and a two-line note, converted with Detect numbers and true/false, table name orders and order_id as the Primary key, then opened with the sqlite3 shell. total became REAL and paid became INTEGER 1/0, while order_id and shipped_on stayed TEXT. With the default Keep every value as text, all six columns are TEXT and total keeps 129.50.

CSV
order_id,customer,total,paid,shipped_on,note
000417,"Okafor, Ada",129.50,true,2026-04-02,
000418,Mei Tan,15,false,,"Leave at door
side gate"
SQLite (sqlite3 shell)
sqlite> .schema
CREATE TABLE "orders" ("order_id" TEXT PRIMARY KEY, "customer" TEXT, "total" REAL, "paid" INTEGER, "shipped_on" TEXT, "note" TEXT);

sqlite> SELECT order_id, total, typeof(total), paid, shipped_on, quote(note) FROM orders;
000417|129.5|real|1|2026-04-02|NULL
000418|15.0|real|0||'Leave at door
side gate'

Questions and answers

What is the difference between this and CSV to SQL?

This page gives you a finished SQLite database file to open directly. CSV to SQL writes a text script of CREATE TABLE and INSERT statements that you run yourself, for SQLite or for PostgreSQL, MySQL or SQL Server, and it can stream files larger than 25 MB.

Can I add the CSV to an existing database?

Not directly; each conversion creates a new database with one table. Attach it from your existing database with ATTACH 'orders.sqlite' AS src; and copy the rows with INSERT INTO … SELECT * FROM src.orders;.

Why are true and false stored as 1 and 0?

SQLite has no boolean storage class; booleans are integers. With Detect numbers and true/false, true becomes 1 and false becomes 0. With text mode they stay the strings true and false.

Standards and references