Token Counter
Count GPT and Claude tokens in any text — free, instant, and it never leaves your browser.
Loading tokenizer… counts appear in a moment.
- Words
- 33
- Characters
- 207
- Chars / token
- —
- Input cost on GPT-5.5
- —
≈ Claude counts are estimated (chars ÷ 3.6); Anthropic's tokenizer is not public. GPT counts are exact (o200k_base).
How it works
Every LLM bill, rate limit and context window is denominated in tokens, yet most developers never see them. This counter makes them visible: paste any text and get the exact GPT token count (o200k_base encoding, the one used by current OpenAI models) plus a documented Claude approximation, words, characters, and what the text costs as input on current models.
Privacy is the point. Online token counters routinely send your text to a server; system prompts and proprietary code deserve better. Here the tokenizer itself — a few megabytes of vocabulary tables — is downloaded to your browser once and runs locally. Your text generates zero network traffic, which you can confirm in devtools.
A few rules of thumb the numbers will teach you: English prose runs ≈4 characters per token; source code ≈3 because symbols and short identifiers fragment heavily; CJK languages can drop below 2. Markdown tables and deeply indented JSON are token-dense relative to the information they carry. When a prompt feels expensive, the chars-per-token stat here tells you whether the problem is length or density.
The cost line prices your text as input at current rates — useful for sizing system prompts, where a 2,000-token preamble re-sent on every call quietly becomes real money at scale. To see what your full sessions cost rather than single prompts, the Agent Session Cost Estimator models the loop, and FORG measures it live from your actual traffic.
One workflow worth adopting: measure your system prompt here once, then check it again after every meaningful edit. System prompts grow by accretion — a clarifying sentence here, an edge-case rule there — and each addition is re-billed on every call forever. Teams that track this number tend to keep preambles under two thousand tokens; teams that do not are often surprised to find five-figure preambles silently multiplying their bills.
Frequently asked questions
What is a token?
Tokens are the chunks a language model actually reads — usually word fragments. 'tokenizer' might split into 'token' + 'izer'. In English prose, 1 token ≈ 4 characters or about 0.75 words. Code tokenizes denser, around 3 characters per token, because of symbols and short identifiers.
Is my text uploaded anywhere?
No. The tokenizer (js-tiktoken) runs entirely in your browser — there is no server call, no analytics on your content, nothing stored. You can verify in your browser's network tab: typing produces zero requests.
Why is the Claude count an estimate?
Anthropic has not published Claude's tokenizer, so no offline tool can count it exactly. We use characters ÷ 3.6, which tracks observed Claude counts within a few percent for English text. The GPT count uses the real o200k_base encoding and is exact.
Why do GPT and Claude token counts differ for the same text?
Each model family uses a different vocabulary. The same text might be 1,000 tokens on GPT's o200k encoding and 1,080 on Claude's. The difference matters when comparing prices: a model with cheaper rates but a less efficient tokenizer can cost more per document.
How do I reduce my token count?
Strip markdown decoration, collapse whitespace, and prefer plain prose over heavily formatted tables (tables are token-expensive). Our Prompt Compressor tool shows exactly how many tokens each cleanup saves.
FORG tracks this automatically across every agent session — live cost attribution, budgets, and alerts.
Start tracking with FORG