Skip to content

AI token counter

Paste text to count its tokens with the encodings OpenAI publishes, and see where the text splits. Counting runs in your browser. To turn a count into a price, use the AI token cost calculator.

…
tokens
28
words
151
characters

Claude, Gemini and other models

Only OpenAI’s encodings are published for offline use, so counts here match OpenAI models. Anthropic and Google provide counting through their APIs instead: Anthropic’s count_tokens endpoint for Claude and Google’s countTokens method for Gemini. Open-weight models ship their tokenizer with the model weights. Context-window sizes per model are on the context window comparison.

Frequently asked questions

Which OpenAI models use which tokenizer?+

OpenAI’s tiktoken library maps GPT-5, GPT-4.5, GPT-4.1, GPT-4o and the o1, o3 and o4-mini reasoning models to o200k_base; gpt-oss to o200k_harmony; and GPT-4, GPT-3.5 Turbo and the text-embedding-3 models to cl100k_base.

Can I count Claude tokens here?+

Not exactly. Anthropic does not publish an offline tokenizer for current Claude models. Its Messages API has a count_tokens endpoint, which Anthropic states is free to use, subject to requests-per-minute limits, and returns an estimate that can differ from the billed count by a small amount. Anthropic also states that models from Claude Opus 4.7 on use a newer tokenizer, so counts from older models should not be reused.

Can I count Gemini tokens here?+

Not exactly. Google’s Gemini API has a countTokens method for that. Google’s guide states that for Gemini models a token is about 4 characters, and 100 tokens are about 60 to 80 English words.

Is my text sent anywhere?+

No. The encoding is downloaded to your browser and the counting runs there; the text you type is not sent to aiblogly or to any AI provider.

Why does the same text give different counts?+

Each encoding has its own vocabulary of text pieces. Text in languages other than English, code and unusual spellings usually split into more pieces than common English words.

Sources (read 25 November 2026)

Related: AI token cost calculator · what is a token? · context window comparison