Reading Anki APKG ZIP archives and SQLite databases offline
Study archives frequently contain unpublished exam notes, clinical mnemonics, and personal language collections that belong exclusively on your device. Dropping an .apkg or .colpkg file runs inspectApkgArchive inside edu.worker.ts without uploading card text or attachments.
Unpacking legacy SQLite collections with WebAssembly
After verifying the file meets the 64 bytes minimum archive threshold, fflate decompresses the ZIP payload in memory with 0 bytes transmitted to external servers. The worker locates collection.anki21 or collection.anki2 formatted according to the SQLite database file format specification, loads self-hosted /vendor/sqljs/sql-wasm-browser.wasm (688 KB), and closes the database handle in a finally block.
Power users wanting schema inspection beyond flashcard fields can also extract the SQLite database file and inspect raw collection SQLite tables directly. Inside this tool, structured queries pull deck trees from col JSON or modern decks tables automatically.
Handling Anki 23.10+ exports and embedded media safely
Shared decks exported from Anki 23.10 and newer sometimes bundle only collection.anki21b zstd binaries without a SQLite fallback. When collection.anki21 and collection.anki2 are both absent, the worker raises a targeted prompt instructing you to re-export with Support older Anki versions enabled.
Community decks can also hide third-party tracking images or inline JavaScript inside card templates. Before rendering Study cards or Browse table, sanitizeAnkiCardHtml strips <script>, <style>, <iframe>, <object>, <embed>, inline on*= attributes, and javascript: links while replacing remote http: or https: images with an offline block notice.
How does browser APKG parsing keep Cloze notes accurate?
Each SQLite row joins cards and notes on nid, splits notes.flds on the ASCII 0x1F unit separator, and applies note-type templates inside WebAssembly. Active {{c1::answer::hint}} tags mask target terms with [hint] or [...] on the front, while reversed templates swap front and back fields whenever cardOrd equals 1.
Parsing 0x1F field delimiters and reversed note templates
Anki separates every field inside a note’s flds column using non-printing 0x1F bytes and follows Anki Manual note fields and Cloze deletion rules for multi-blank cards. Our parser inspects each template ordinal (ord), renders extra Cloze back text after a line divider, and avoids emitting broken literal brackets.
You can test mixed note models immediately by clicking Load sample Anki deck, which synthesizes sample-anatomy-flashcards.apkg with 5 Basic and Cloze anatomy cards. Medical researchers pairing flashcard review with literature notes can also keep academic citation keys offline alongside study decks inside the same private workspace.
Filtering subdecks, tags, and study states in the browser
Once extraction finishes, the summary header reports the detected collection format, subdeck count, total cards, and local media asset count. Nested hierarchy paths stored with 0x1F separators automatically normalize to readable :: subdeck breadcrumbs.
- Subdeck selector: Isolate nested deck branches like
Anatomy::Thoraxwithout changing the underlying.apkgarchive on disk. - Tag filter menu: Filter notes by normalized tag strings parsed from whitespace-padded SQLite
notes.tagsvalues before browsing or exporting. - Search cards input: Match case-insensitive substrings across stripped plain-text fronts, backs, deck breadcrumbs, and tag labels simultaneously.
- Study cards mode: Step through active decks using Previous card, Next card, and Show answer or Hide answer controls with local audio and images rendered inline.
Exporting flashcards to CSV, Excel, JSON, and printable PDFs
Every export action operates on filteredCards, letting you slice one chapter with Subdeck or Tag filter before clicking Download CSV, Download Excel, Download JSON, or Download PDF. Consult the Anki Manual packaged deck export guide whenever re-exporting from desktop Anki for universal compatibility.
| Output option | Structure & layout | Scheduling metadata | Primary use case |
|---|---|---|---|
| Download CSV | UTF-8 RFC 4180 comma-separated 7 columns |
State and Interval (days) |
Spreadsheet review or deck edits |
| Download Excel | .xlsx workbook sheet Anki Cards |
State and Interval (days) |
Academic course packs in Excel |
| Download JSON | Indented array with cardId keys |
String status and intervalDays |
Scripted study pipelines and backups |
| Download PDF | 2x4 grid on Letter 10 pt duplex |
Omit intervals for clean study | Double-sided printed flashcards |
| Study cards | Interactive flip card UI with media | Displays subdeck and tag pills | Zero-install cramming offline |
Tip: Narrow a large exam package using Subdeck and Tag filter before clicking Download PDF, because the
215.9 x 279.4 mmsheet prints8cards per page with cut lines on the active filtered list only.
When spreadsheet edits are finished and you want to turn updated CSV rows or Markdown notes back into an importable Anki deck, switch directly to our CSV and Markdown Anki package builder. Keeping both conversion directions inside browser tabs removes desktop add-on dependencies.
Inspecting media blobs, review intervals, and deck metadata
Beyond plain question text, .apkg bundles frequently ship diagram graphics, pronunciation recordings, and spaced-repetition state counters that guide study priority. Local parsing preserves both media payloads and SQLite scheduling metadata while cleaning up temporary memory references automatically.
Reviewing card state flags and scheduling intervals safely
SQLite queries map cards.type integer codes directly to readable labels: 0 becomes new, 1 becomes learning, 2 maps to review, and 3 maps to relearning. Reading cards.ivl alongside card status lets tutors and learners spot mature concepts versus freshly missed material inside CSV or JSON exports.
Local audio tags formatted as [sound:filename.mp3] extract out of card HTML and mount native <audio controls> players beneath the card text. Supported .png, .jpg, .webp, .gif, .svg, .mp3, .ogg, and .wav assets decode from ZIP numeric keys matched against the media JSON index.
Pairing flashcard decks with local study and medical tools
To render local images without touching external networks, the viewer converts unzipped binary buffers into Blob URLs following the MDN URL.createObjectURL memory management specification. Running revokeMediaUrls whenever a new file loads or the component unmounts frees temporary browser memory immediately.
Anatomy trainees and radiology residents combining spaced-repetition decks with local imaging review can move directly from visual flashcards into our DICOM medical scan viewer and PHI anonymizer. Both workflows process study archives strictly inside client Web Workers with zero cloud uploads.