s3ga1ov152 downloadsDisplays the token count of the active note in the status bar using TikToken
This plugin for Obsidian displays the token count for the currently active note in the status bar. It uses the js-tiktoken library, JavaScript port of OpenAI's tiktoken with the o200k_base encoding shared by gpt-4o and the gpt-5 family.

When you open a note or edit its content, the plugin recalculates the number of tokens and updates the status bar. A 150 ms debounce keeps Obsidian responsive while you type. Tokenization runs entirely in JavaScript with no WebAssembly or network calls, so it works on both desktop and mobile.
The plugin ships two modes, selectable in Settings → Community plugins → TikToken Tokenizer:
o200k_base encoding shared by gpt-4o and the gpt-5 family. This is the actual tokenizer OpenAI uses, so the count is exact.Anthropic does not publish an offline tokenizer for Claude 3 or later — the only exact way to count Claude tokens is the /v1/messages/count_tokens API, which requires an API key and a network round-trip per call. This plugin keeps everything local, so for Claude it offers an approximation rather than an exact count.
Methodology. Before Claude 3, Anthropic used a custom BPE tokenizer with vocabulary on the order of 100K. Of publicly available encodings, OpenAI's cl100k_base (GPT-3.5 / GPT-4 family) is the closest analogue. On top of the raw cl100k_base count this mode applies a fixed +15% safety margin (Math.ceil(count × 1.15)), so the displayed number is intentionally a slight over-estimate — better to be pleasantly surprised than to blow past your context window.
Use it for budgeting your context window. If Anthropic publishes an official offline tokenizer for Claude 3+, this mode will switch to the exact implementation.
Settings → Community plugins.Browse and search for "TikToken Tokenizer".Install, then Enable.main.js and manifest.json from the latest release.YourVault/.obsidian/plugins/tiktoken-tokenizer.Settings → Community plugins, find "TikToken Tokenizer", and enable it.git clone https://github.com/S3ga1ov/tiktoken-tokenizer.git
cd tiktoken-tokenizer
npm install
npm run build
This produces main.js in the project root.
This plugin is licensed under the MIT License.