Search...Search plugins and themes...
⌘K
Sign in
  • Get started
  • Download
  • Pricing
  • Enterprise
  • Account
  • Obsidian
  • Overview
  • Sync
  • Publish
  • Canvas
  • Mobile
  • Web Clipper
  • CLI
  • Learn
  • Help
  • Developers
  • Changelog
  • About
  • Roadmap
  • Blog
  • Resources
  • System status
  • License overview
  • Terms of service
  • Privacy policy
  • Security
  • Community
  • Plugins
  • Themes
  • Discord
  • Forum / 中文论坛
  • Merch store
  • Brand guidelines
Follow us
DiscordTwitterBlueskyThreadsMastodonYouTubeGitHub
© 2026 Obsidian

TikToken Tokenizer

s3ga1ovs3ga1ov152 downloads

Displays the token count of the active note in the status bar using TikToken

Add to Obsidian
  • Overview
  • Scorecard
  • Updates5

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.

Token count in status bar

How it works

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.

Tokenizer modes

The plugin ships two modes, selectable in Settings → Community plugins → TikToken Tokenizer:

  • GPT-4o / GPT-5 (exact) — default. Uses the o200k_base encoding shared by gpt-4o and the gpt-5 family. This is the actual tokenizer OpenAI uses, so the count is exact.
  • Claude (approximate) — see below for methodology.

About the "Claude (approximate)" mode

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.

Installation

From the Community Plugin list

  1. Open Obsidian and go to Settings → Community plugins.
  2. Click Browse and search for "TikToken Tokenizer".
  3. Click Install, then Enable.

Manual Installation

  1. Download main.js and manifest.json from the latest release.
  2. Create a new folder in your vault's plugins directory: YourVault/.obsidian/plugins/tiktoken-tokenizer.
  3. Copy both files into the new folder.
  4. Reload Obsidian.
  5. Go to Settings → Community plugins, find "TikToken Tokenizer", and enable it.

For Developers

Building the plugin

  1. Clone the repository:
    git clone https://github.com/S3ga1ov/tiktoken-tokenizer.git
    
  2. Navigate to the repository folder:
    cd tiktoken-tokenizer
    
  3. Install the dependencies:
    npm install
    
  4. Run the build script:
    npm run build
    

This produces main.js in the project root.

License

This plugin is licensed under the MIT License.

99%
HealthExcellent
ReviewPassed
About
Display the token count for the active note in the status bar and update it as you type. Two tokenizer modes, switchable in plugin settings: exact counts for `gpt-4o` and the `gpt-5` family via the `o200k_base` encoding, plus an approximate Claude mode that uses `cl100k_base` with a 15% safety margin. Runs entirely in JavaScript — no WebAssembly, no network calls.
Status barAIEditing
Details
Current version
1.1.1
Last updated
5 days ago
Created
10 months ago
Updates
5 releases
Downloads
152
Compatible with
Obsidian 0.15.0+
Platforms
Desktop only
License
MIT
Report bugRequest featureReport plugin
Author
s3ga1ovs3ga1ov
github.com/S3ga1ov
GitHubs3ga1ov
  1. Community
  2. Plugins
  3. Status bar
  4. TikToken Tokenizer

Related plugins

Gemini Scribe

Allows you to interact with Gemini and use your notes as context.

Advanced Tables

Improved table navigation, formatting, and manipulation.

Copilot

Your AI Copilot: Chat with Your Second Brain, Learn Faster, Work Smarter.

Claudian

Embeds Claude Code/Codex as an AI collaborator in your vault. Your vault becomes agent's working directory, giving it full agentic capabilities: file read/write, search, bash commands, and multi-step workflows.

Smart Connections

AI link discovery copilot. See related notes as you write. Lookup using semantic (vector) search across your vault. Zero-setup local model for embeddings, no API keys, private.

Meta Bind

Make your notes interactive with inline input fields, metadata displays, and buttons.

Outliner

Work with your lists like in Workflowy or Roam Research.

Various Complements

Complete words similar to auto-completion in an IDE.

Agent Client

Chat with Claude Code, Codex, Gemini CLI, and more via the Agent Client Protocol — right from your vault.

Creases

Tools for effectively folding Markdown sections.