SQLite to CSV: Export a Table or Query
Open your SQLite database, choose a table and edit the single-table SELECT to select or filter its columns. Download full query CSV exports every row returned by that query when its scan finishes. Copy and Download export only the displayed page; this page starts with 25 rows per page so that boundary is visible. Each CSV includes a header and quoted text. This exports one supported query, not every table in the database at once.
tables 4
items
- idINTEGER rowid
- order_idINTEGER
- productINTEGER
- qtyINTEGER
- noteTEXT
- thumbBLOB
1 view: open_orders
opened read-only
| id | note | thumb |
|---|---|---|
| 1 | gift wrap | NULL |
| 2 | NULL | NULL |
| 3 | NULL | NULL |
| 4 | back order | NULL |
| 5 | NULL | BLOB 16 bytes |
| 6 | NULL | NULL |
| 7 | NULL | NULL |
| 8 | engraving: A.W. | NULL |
| 9 | NULL | NULL |
| 10 | NULL | NULL |
| 11 | NULL | NULL |
| 12 | left handed | NULL |
| 13 | NULL | BLOB 14 bytes |
| 14 | NULL | NULL |
| 15 | NULL | NULL |
| 16 | palletised | NULL |
| 17 | NULL | NULL |
| 18 | NULL | NULL |
| 19 | NULL | NULL |
| 20 | the long note that follows is here to prove the reader follows an overflow chain: a row whose payload does not fit inside one 512-byte page is stored with the first part of the record on the leaf page and the rest on a chain of overflow pages, each of which begins with a four-byte pointer to the next one. A viewer that reads only the leaf page shows a value cut off at the page boundary and never says so, which is the failure this note exists to catch. Every character you can read here, all the way to the final full stop, came back out of that chain in order and was compared against the string that went in. | NULL |
| 21 | NULL | NULL |
| 22 | NULL | NULL |
| 23 | assorted | NULL |
| 24 | NULL | NULL |
- Tables
- 4
- Rows in table
- 24
- Page size
- Mode
- Read-only
Copy and Download export the displayed page. exports every row returned by this supported SELECT only if its scan finishes.
24 rows on screen, 1 to 24 of 24 from items, page 1 of 1.
- 4 tables, 64 rows, nothing written
- NULL shows as NULL, a BLOB as its byte length: 16 bytes
- UPDATE is refused here: the file is opened read-only and only SELECT runs.
Common questions
- Can SQLite to CSV export the whole query result?
- Download full query CSV exports all rows returned by the supported SELECT, including its own LIMIT and OFFSET, independently of Page size. A stopped scan or sort refuses that full export rather than downloading a prefix. Copy and Download still export only the page on screen; the result status identifies those rows.
- How do NULL, empty strings and BLOBs appear in the CSV?
- NULL becomes an empty unquoted field, while an empty text string is a quoted empty field. Commas, quotes and line breaks are escaped using CSV quoting. A BLOB becomes metadata such as blob:16 bytes; its binary content is not exported.
- Can I open the CSV in Excel?
- Yes, import or open the CSV in spreadsheet software. This tool produces CSV text, not an .xlsx workbook, and spreadsheet type inference may alter large integer or date-like strings. Import those columns as text when their exact text matters.
- Can it combine tables or export joined results?
- This viewer reads one table at a time and refuses joins or functions. SQLite Playground executes joins and can copy its displayed result sets as tab-separated text; a desktop SQLite application can handle complete database exports.
Every byte comes from the SQLite file format, read in this browser: the file is opened read-only, never uploaded and never written back. Only SELECT over one table runs here, and a statement that would write, attach or load an extension is refused by name. Rows that live only in an unread -wal file, and tables in a shape this reader names as one it cannot decode, are reported rather than shown.