LLM Token Counter & Context Calculator
Lazy local tiktoken encodingsCount tokens, compare encodings, budget messages and split prompts with local tiktoken.
Source text
Text is encoded in this browser after its selected rank table loads.
Interactive token map
Hover for index, token ID and decoded UTF-8; click a token to copy its ID.
No token matches this filter.
| # | ID | Text | UTF-8 |
|---|
How to use it
- 01
Tokenize the exact text
Choose o200k_base or cl100k_base and inspect token IDs, visible text and UTF-8 representations locally.
- 02
Plan the context budget
Model messages, tool schema, context window, reserved output and illustrative per-million prices.
- 03
Chunk and export
Create token-bounded overlapping chunks and export token rows or a caveated planning report.
Frequently asked questions
Are raw text counts exact?
They are exact for the selected bundled encoding. A particular API model may select a different encoding or add service-specific content.
Why is message overhead labeled estimated?
Roles, wrappers, tools and service behavior vary by model and API revision; use the provider's server-side input-token endpoint as final authority where available.
Are the displayed costs current model prices?
No fixed price claim is made. Both per-million fields are user-editable planning inputs and default to zero.
Does prompt content leave the browser?
No. Encoding ranks are bundled as lazy static assets and tokenization, comparison and chunking are local.
Related tools
Keep working with other focused browser utilities.