hanstat

How hard is this book for you? hanstat counts the characters and words of Chinese .epub and .txt files and measures them against what you know: your Anki cards, vocabulary levels (HSK 3.0 of 2025 and 2021, HSK 2.0, TOCFL) and word lists. It keeps a library of your books, suggests an order to read them in, and tracks the books you've read.
Runs on Windows, macOS and Linux. The Mac app's font handling and self-updating are by @linlin56, from #1.

Install
Windows (x64): download hanstat-x86_64-pc-windows-msvc.zip, unzip it and run hanstat.exe. It isn't code-signed, so SmartScreen may ask you to confirm the first run.
macOS (Apple Silicon, macOS 11+): download hanstat-aarch64-apple-darwin.zip, unzip it and move hanstat.app to Applications. It isn't notarised: the first time, macOS refuses to open it; go to System Settings → Privacy & Security and click Open Anyway.
Linux (x86-64): download hanstat-x86_64-linux.flatpak and install it with flatpak install --user hanstat-x86_64-linux.flatpak (or open it in your software centre). It brings its own CJK fonts. Under Wayland, files dropped on the window don't arrive; use 📂 Open….
hanstat updates itself on Windows and macOS (click the version in the status bar to check now, or to turn it off). On Linux, install the newer .flatpak the same way.
The first start downloads the Chinese segmenters (about 80 MB).
Use
Open a book or drop it on the window. It is segmented with LTP (Simplified) or CKIP (Traditional). Idioms count as one word, and the rare non-words a segmenter makes by misplacing a boundary (木柯跑, 他/妈凭/什么) are split again into dictionary words and the book's own names. The tabs show the overview, every character and word with its count, the sections (untick front and back matter), and names the segmenter may have split.
Reading. 📕 Read beside a book's title opens it in a paginated reader, horizontal (one or two pages side by side) or vertical on a landscape page: an EPUB with its own layout and pictures, a TXT with its detected chapters as pages and its chapter headings in Contents, in the installed fonts you choose. It reopens where you left off, and times your reading: a line under the pages shows the session, characters, speed and time left, Stats has today, the book, a daily goal and streaks, and Library Stats › Reading has a calendar and charts by year, month, week or day. Reading times use your measured speed unless you set one in Settings, where you can also reset all reading stats (a copy of the old ones is kept). Drag to select text and use Copy from the right-click menu or press Ctrl+C. Hold Shift over a word to look it up in your Yomitan dictionaries (Dictionaries in the reader's bar imports them and keeps them up to date). The + beside a word adds it to Anki through AnkiConnect, greyed out when it is already there, with the word and its sentence said by your Read aloud voice; the ✓ beside it marks the word known. Aa can highlight the words you don't know yet, or every word by its status in Anki, with an underline or a background in the theme's own colours. Ctrl+F searches the whole book: a result opens its page without moving your reading place or stats, and Back returns you. With your own Azure Speech key, Read aloud can use an Azure neural voice, or, free and offline after a one-time download, Qwen3-TTS on your graphics card, which needs about 3.6 GB of graphics memory (a 4 GB card is just enough; 8 GB reads fastest). Choose Play from here from the right-click menu to start reading aloud at that sentence. The sentence heard is highlighted, the pages turn with it, and while reading you can click a word to jump to its sentence, skip a sentence back or forward (Ctrl+← / Ctrl+→), pause with K, and change the playback speed from 0.5× to 2× without making the audio again. A chapter or the whole book can be made ahead of time.
Transferring book audio. On the book Overview, open Export…. To take the book with you, tick Include the EPUB in the package or Include the TXT in the package. Choose Book audio package (.hbook)… to save the available recordings. On another instance, choose Import… beside Export on the main toolbar. An audio-only package uses the matching book in your Library or asks you to locate a copy.
Reader translations. Right-click a sentence or selection to translate it into English with Hy-MT3-1.8B. The reader downloads the 1.35 GB model on first use and translates offline. Drag the striped corner of the translation popup to resize it. Tencent model card
DuChinese. Library › Add from DuChinese… lists graded stories, courses and standalone articles. It shows how much of those on screen or already downloaded you'd know, worked out from your known words; a premium article's is worked out when you ask. Known % for everything downloads every first chapter for this, at your own risk. Use Articles to include individual readings outside collections. Import saves the selected item as an EPUB in your Library, in Simplified or Traditional and optionally with sentence translations and native audio. Sign in with a DuChinese subscription for premium readings. New chapters are added to imported series as they come out, and the book keeps its reading stats and place.
What you know. Click 🃏 Anki, tick your decks and the field that holds the word: young and mature cards count as known (your collection is only read, never changed). Or click 📚 to tick vocabulary levels (HSK 3.0 of 2025 or 2021, HSK 2.0, TOCFL) or import word lists, and mark single words known with + in the Words tab.
Names. Character names inflate the unknown words. Suggested words lists the likely names and terms the segmenter split or glued to other words; apply them, or type one into Force a word.
Library. Every book you open is added to 📖 Library, with its length, the share of running words you know, its difficulty and reading time; click a column to sort. Rows update on their own when what you know changes. Click ✔ in the Read column once you've read a book: the most frequent of its words (90% of those it uses 10+ times, adjustable) count as known from then on, and so do words met 10+ times across the books you've read; it leaves the reading path. Untick Count as known to mark it read without its words.
Reading path. Library → Reading path orders the books from easiest to hardest as you learn. In Learn while reading you study nothing beforehand: each book teaches the words it uses often (and words met often across books), and the books are ordered so that each one's first chapters are as easy as they can be; a long book that repeats its words counts as easier than its vocabulary size suggests, and the book you're reading comes first. In Study before each book it lists the words to study before each book until you know 95% of its running words (or a fixed number), so that they make the next ones easier. Series are read in order, and 💾 saves a book's word list for Anki.
Stats. Library → Stats shows the library as a whole: how much of it you know, how hard each book is now, the books you've read, and the unknown words that the most books use.
Writing style (optional, Chinese only). Turn on Rate writing style with a local AI model in ⚙ to rate how hard each book's prose is beyond its words. The rating is shown against the other rated books of your Library (50% is their median, the plainest near 0%, the most literary near 100%), with a word for where it falls on its own: plain, typical, literary or very literary. It runs Qwen3.5-4B locally through llama.cpp (a 2.7 GB download; books never leave your computer) and counts toward the difficulty with the weight set in ⚙.
Anki add-on
Hanstat TTS (code 194815963) adds word and sentence audio to your Anki cards with hanstat's voices: the local Qwen3-TTS voice, including the voices you designed or imported, or Azure with the key saved in hanstat. Set up a voice in Read aloud first; hanstat doesn't need to be running.
Command line
hanstat-cli file.epub [--anki] [--level N] [--known-list words.txt] [--json] [--words-csv f] [--library]
hanstat-cli --plan [--lang zh|ko|ja] [--target 95] [--study-lists DIR]
hanstat-cli --help lists every option. On macOS it's hanstat.app/Contents/MacOS/hanstat-cli; in the Flatpak, flatpak run --command=hanstat-cli io.github.caocaochan.hanstat.
Data
Settings, the Library (with its own copy of each book, in books) and your known words are in %LOCALAPPDATA%\hanstat (macOS: ~/Library/Application Support/hanstat, Linux: ~/.local/share/hanstat, Flatpak: ~/.var/app/io.github.caocaochan.hanstat/data/hanstat); the models and saved analyses are there too on Windows and macOS, and in ~/.cache/hanstat on Linux. CHANGELOG.md describes every feature and change in detail.
Licence
MIT or Apache-2.0, at your option, except the mascot's pictures (assets/mascot/sheet.png, docs/mascot/sprite.js): unofficial fan art of 魏无羡 from 墨香铜臭's 《魔道祖师》, which this licence doesn't cover. Bundled data: OpenCC (Apache-2.0); jieba dictionary (MIT); general-language headwords from CC-CEDICT, CC BY-SA 4.0 (see data/CEDICT-LICENSE.txt); idiom and word headwords (no definitions) from 新华成语大词典, 汉语成语源流大辞典, 现代汉语规范词典, 现代汉语词典 and 國語辭典簡編本 (see data/Headwords-LICENSE.txt); HSK list from the official syllabus via ofou/hsk (MIT); 2021 HSK 3.0 list from GF 0025-2021 via ivankra/hsk30 (MIT, see data/HSK-LICENSE.txt); HSK 2.0 (2012) lists from hskhsk.com (MIT, see data/HSK20-LICENSE.txt); TOCFL list from SC-TOP's 華語八千詞表 (free download, no licence stated; only the words are bundled). Downloaded models: LTP is free for research and individual use (commercial use needs a licence from HIT-SCIR), CKIP bert-tiny is GPL-3.0; for writing style, Qwen3.5-4B (GGUF by Unsloth) is Apache-2.0 and llama.cpp MIT. Book titles in exported images: LXGW WenKai Medium 1.530, bundled, SIL OFL 1.1 (see assets/fonts/LXGWWenKai-LICENSE.txt). Interface text on macOS and Linux: Inter 4.1, bundled, SIL OFL 1.1 (see assets/fonts/Inter-LICENSE.txt). Fonts in the Linux Flatpak: Noto Sans CJK and Plangothic, both SIL OFL 1.1.