Token Counter
Count tokens for any common tokenizer and estimate cost per model.
- Recent results are kept in this browser's local storage until you clear them.
History kept on this device
Recent results are kept in this browser's local storage until you clear them. - Processing happens in this page. No application server receives your input.
Runs in your browser
Processing happens in this page. No application server receives your input.
Prompt text
Counts
- Tokens
- 0
- Characters
- 0
- Graphemes
- 0
- Bytes
- 0
- Encoding
- o200k_base
- Characters per token
- 0.00
- Estimated input cost
- $0.00 ($0.00 cached)
- Prices as of
- 2026-02-01
What this tool does
Counts BPE tokens for a chosen model using that model's real tokenizer in a dedicated Web Worker, names the encoding it used, and estimates input cost from a dated price snapshot (2026-02-01). Enabling the breakdown toggle reveals a per-token table showing each token's ID, text, UTF-8 byte length, and UTF-16 span.
Context-fit indicator
The context-fit pill compares the token count against the model's full context window: green (ok) below 80%, amber (warn) between 80% and 100%, and red (bad) above 100%. Both numbers are always included in the pill text.
Limits
This counts the text you pasted. A chat request also carries a system prompt, a role envelope per message, and any tool definitions, so the number a provider bills will be higher: T55 accounts for the envelope separately. Cost is an estimate against prices last checked on the date shown, and it applies the standard rate: batch, cached-input, and negotiated discounts are not modelled unless the vendor publishes a cached rate. A model with no bundled tokenizer gets no count; enter one from a response's usage field and cost is computed from that.
Scope: this covers the page itself. Your browser, operating system, clipboard, downloads, extensions, and crash recovery may keep copies, and a compromised site origin would not be protected.