How the counter works
The counter uses gpt-tokenizer, an MIT-licensed port of OpenAI's tiktoken, with the o200k_base vocabulary of about 200,000 tokens. It loads only when you start using the text box, and it runs in a background worker, so a long paste does not freeze the page.
On our test texts its counts match tiktoken 0.14.0, OpenAI's own Python library. Special markers such as <|endoftext|> are counted as plain text. The character count includes spaces and line breaks.
Which OpenAI models use which tokenizer
OpenAI's tiktoken library maps each model name to a tokenizer. On 9 Nov 2026 every GPT-5 model maps to o200k_base, and so do GPT-4.1, GPT-4o and the o-series.
| Models | Tokenizer | Counted here |
|---|---|---|
| GPT-5.6 Sol, Terra and Luna | o200k_base | Yes |
| GPT-5, GPT-5.4 and GPT-5.5 | o200k_base | Yes |
| GPT-4.1 and GPT-4o | o200k_base | Yes |
| o1, o3 and o4-mini | o200k_base | Yes |
| GPT-6 Astra, Sol, Terra and Luna | Not published | No |
| GPT-4 and GPT-3.5 Turbo, both shut down | cl100k_base | No |
| text-embedding-3-small and text-embedding-3-large | cl100k_base | No |
tiktoken has no entry for GPT-6 models, and a request to add one was closed as not planned. This page does not guess a GPT-6 count.
Tokens in a real API request
The counter counts plain text. A real request has more tokens than its text: message roles and boundaries, tool definitions, schemas and images all add to the count.
For the exact number, OpenAI's input token count endpoint, POST /v1/responses/input_tokens, returns what the model will receive, formatting tokens included. It needs an API key and is free to call.
Counting Claude and Gemini tokens
Claude and Gemini split text with their own tokenizers, so an OpenAI count is the wrong number for them. Anthropic says Claude 4.7 and later models produce about 30% more tokens for the same text than earlier Claude models.
Anthropic's token counting endpoint is free but rate limited, and it returns an estimate. Google's countTokens method returns the count for Gemini, and Google's rule of thumb is about 4 characters per token. Both need an API key, and both are linked under sources.
From tokens to a monthly bill
A token count tells you what one prompt costs. For a month, put the count into the AI API cost calculator with your output length and daily requests.
When the real bill grows faster than the plan, Costbrake alerts you. It reads spend from OpenAI and Anthropic, alerts when an hour costs 3x your usual hour and at least $5 more, and tracks budgets at 50, 80 and 100 percent. The Free plan covers 2 accounts. See pricing.
Questions and answers
How many characters are in a token?
For English text, OpenAI says 1 token is about 4 characters and 100 tokens are about 75 words. Other languages and code split differently, so paste your real text for the exact count.
Is my text sent anywhere?
No. The tokenizer runs in a worker inside your browser, and the text never leaves your device. Our analytics only record that a count happened and its rough size, such as 1K to 10K tokens.
Is this the same as OpenAI's tokenizer?
Yes, for plain text on o200k_base models. It uses the same vocabulary as tiktoken, OpenAI's library, and matched tiktoken's counts on our test texts. API requests add a few formatting tokens on top, which OpenAI's input token count endpoint includes.
Can it count tokens for Claude or Gemini?
No. Claude and Gemini use their own tokenizers, and their counts come from Anthropic's and Google's APIs, which need an API key. We do not show a guess. Use Anthropic's token counting endpoint or Google's countTokens method, both linked under sources.
Why are GPT-6 models not covered?
tiktoken, OpenAI's tokenizer library, has no GPT-6 entry, and we found no OpenAI page that names the tokenizer GPT-6 uses, so a count here could be wrong. For GPT-6 prompts, use OpenAI's input token count endpoint.
What does the input cost show?
Your token count times the standard input price of gpt-5.6-sol, gpt-5.6-terra and gpt-5.6-luna, checked on 9 Nov 2026. It covers uncached input only. Output tokens are billed on top, and prompts over 272K tokens move to OpenAI's long context rate.
Sources
- tiktoken model.py - openai/tiktoken
- gpt-tokenizer - niieani/gpt-tokenizer
- Understanding and counting tokens - OpenAI Help Center
- Counting tokens - OpenAI API docs
- Token counting - Claude Platform Docs
- Understand and count tokens - Gemini API
- Update for gpt-6 models - tiktoken issue 608
- Pricing - OpenAI API docs
Updated