Your text
Tokens in your text
Type or paste text above to see how it splits into tokens.
Each shaded block is one token. Hover a block to see its token ID. A block can hold more than one ID when a single character, such as some emoji or CJK characters, is split across several tokens.
Token count
Tokens
0
Counted with o200k_base
Words
0
Characters
0
Tokens per word
0.00
Characters per token
0.00
Words per token
0.00
How this counts
Tokens are counted with js-tiktoken, a JavaScript port of OpenAI's open-source tiktoken library, using the encoding you pick. This is the count for the text itself. An API request can report a few more tokens, because chat messages carry formatting, and images, files and tool definitions are counted separately. Characters are Unicode characters, so an emoji counts as one.
Claude and Gemini
Anthropic's Claude and Google's Gemini use their own tokenizers, so the numbers here apply to OpenAI encodings only. Both providers document how to count tokens for their models; Google's own rule of thumb for Gemini is about 4 characters per token, or 60 to 80 English words per 100 tokens. Anthropic gives no such ratio, and calls its token count an estimate.
Which encoding to use
o200k_base
The encoding tiktoken maps to GPT-4o, GPT-4.1, GPT-4.5, GPT-5 and the o1, o3 and o4-mini reasoning models. Use it for current OpenAI chat models.
cl100k_base
The encoding tiktoken maps to GPT-4, GPT-3.5 Turbo and the text-embedding-3 and ada-002 embedding models. Use it for those older chat models and for embeddings.
Other providers
Claude, Gemini, Llama and other model families each have their own tokenizer. The same text gives a different count in each, so use the provider's own counter for those.
Fit a context window
Check that a long prompt, document or transcript fits a model's context window before you send it, with room left for the reply.
Estimate API cost
Multiply the token count by the price per token on the provider's pricing page to estimate what a request will cost as input.
Compare text and encodings
See how numbers, links, code and other languages change the tokens per word, and how the older cl100k_base encoding compares with o200k_base on the same text.
Sources
- OpenAI tiktoken — model to encoding map
- Anthropic — Token counting
- Google AI for Developers — Understand and count tokens
Limits last checked against these sources on 2026-10-19.
More tools
Related tools
Count words and characters, check how readable a draft is, or turn a word count into pages.