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
- Open a
.csv,.tsvor.txtfile, 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. - Check the Table name. It starts as the file name with spaces and punctuation turned into underscores, so
orders 2026.csvbecomesorders_2026. - Choose Value types, an optional Primary key, and whether to Write empty cells as NULL.
- Select Download SQLite, then open the file, for example with
sqlite3 orders.sqliteandSELECT * 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 names | Used 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 text | The default. Every column is declared TEXT and stores each value exactly as written. |
| Detect numbers and true/false | A 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 key | Optional. 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 NULL | On 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.
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> .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.