← Back to Tools

🔢 Token Counter

Estimate how many tokens your text uses across major LLM tokenizers. Runs entirely in your browser — no text is sent anywhere.

Characters: 0  ·  Words: 0  ·  Lines: 0

🤖

GPT-4 / GPT-3.5

cl100k_base (tiktoken approximation)

0

tokens

Context window (GPT-4o) 128,000
0% 128,000 remaining
🧠

Claude 3.5 / Claude 4

Anthropic tokenizer (approximation)

0

tokens

Context window (Claude 4 Opus) 200,000
0% 200,000 remaining

Context window reference

Model Context % Used Remaining

How token counting works

This tool uses a rule-based approximation of the cl100k_base tokenizer (used by GPT-4 and GPT-3.5-turbo) and a similar heuristic for Claude's tokenizer. The actual token count from the official API may differ by ±5–10% for most text.

Token counts matter because LLMs have a fixed context window — sending more tokens than the limit will cause the model to truncate your message or return an error.

Note: Tokens are not characters. In English, 1 token ≈ 4 characters or ¾ of a word. Code and non-English text typically uses more tokens per character.

How to use this tool

  1. 1 Paste or type your text into the input field.
  2. 2 The tool counts tokens as you type using the selected tokenizer.
  3. 3 Select the model (GPT-4, Claude, etc.) to see how that model counts your text.
  4. 4 Trim your prompt if the count exceeds the model's context window limit.

Frequently asked questions

What is a token?
A token is a chunk of text a language model processes at once. It is roughly 4 characters or 0.75 words in English. Punctuation and common words are often single tokens.
Why does token count matter?
API pricing is usually per token. Context window limits (how much text a model can process at once) are measured in tokens. Knowing your count helps control costs and avoid errors.
Do different models count tokens the same way?
No. Each model has its own tokenizer. GPT-4 uses tiktoken. Claude uses its own tokenizer. The same text may produce a different count for each model.
What is a context window?
The maximum number of tokens a model can process in a single request, including both input and output. Exceeding this limit causes an error.

You might also like