How to use this LLM token counter
- Add your text. Paste a prompt, drop a text file or try one of the samples. Code, JSON and non-English text use tokens at different rates, so test the real thing.
- Pick a model. The main result shows that model's token count, how much of its context window the text fills and the input cost of one call.
- Check the split. Switch to Tokens to see where the text breaks, or Token IDs to see the numbers the model receives.
The counting runs in a worker inside your browser. Nothing you paste is sent to Pixel or to any model provider, so it is safe to test private prompts here.
How accurate is each token count
Only OpenAI publishes the tokenizer its models use. Other providers keep theirs private and offer a counting API instead, so any free browser tool can only estimate them. This counter labels each result so you know which kind you are reading.
| Count type | Models | How it is counted |
|---|---|---|
| Exact | GPT-5.6 family | OpenAI's public o200k_base encoding, the one its tiktoken library maps to GPT-5 models. |
| Near exact | GPT-6 family | o200k_base, the newest encoding OpenAI publishes. tiktoken does not list GPT-6 yet, so we show a small margin. |
| Estimate | Claude, Gemini, Grok, DeepSeek, Mistral | Scaled from the o200k_base count and shown with a range. Use it for planning, and use the provider's API for billing-grade numbers. |
Token counts for GPT, Claude and Gemini
OpenAI GPT and ChatGPT token counter
GPT-5.6 and GPT-6 models split text with OpenAI's o200k_base encoding, the same one behind ChatGPT. This counter runs that tokenizer in your browser, so GPT counts are exact or within a small margin, and the Token IDs view shows the numbers the model receives.
Claude token counter
Anthropic says Claude 4.7 and later use a newer tokenizer that produces about 30% more tokens for the same text. A counter that treats Claude like GPT will undercount it, and a prompt budget made on an earlier model can come up short after an upgrade. This counter scales Claude 5.x counts by 1.3 and leaves Claude Sonnet 4.6 on the older basis.
Gemini token counter
Google does not publish the Gemini tokenizer, so Gemini 4 and Gemini Flash counts here are estimates with a range. Gemini models take up to 1 million tokens of context, so for most prompts the useful question is cost, not fit. Grok, DeepSeek and Mistral are estimated the same way.
Context window and token count by model
Every model in the counter, with its context window, its maximum output and roughly how many tokens 1,000 English words become. Counts for Claude 5.x reflect Anthropic's newer tokenizer.
| Model | Context window | Max output | Tokens per 1,000 words | Count type |
|---|---|---|---|---|
| GPT-6 AstraOpenAI | 1.05M | 128,000 | 1,330 | Near exact |
| GPT-6.1 SolOpenAI | 1.05M | 128,000 | 1,330 | Near exact |
| GPT-6.1 TerraOpenAI | 1.05M | 128,000 | 1,330 | Near exact |
| GPT-6 LunaOpenAI | 1.05M | 128,000 | 1,330 | Near exact |
| GPT-5.6 SolOpenAI | 1.05M | 128,000 | 1,330 | Exact |
| GPT-5.6 TerraOpenAI | 1.05M | 128,000 | 1,330 | Exact |
| GPT-5.6 LunaOpenAI | 1.05M | 128,000 | 1,330 | Exact |
| Claude Fable 5.1Anthropic | 1M | 128,000 | 1,730 | Estimate |
| Claude Opus 5.5Anthropic | 1M | 128,000 | 1,730 | Estimate |
| Claude Sonnet 5.5Anthropic | 1M | 128,000 | 1,730 | Estimate |
| Claude Haiku 5.5Anthropic | 1M | 128,000 | 1,730 | Estimate |
| Claude Sonnet 4.6Anthropic | 1M | 64,000 | 1,330 | Estimate |
| Gemini 4 ArgonGoogle | 1M | 65,000 | 1,330 | Estimate |
| Gemini 3.8 FlashGoogle | 1M | 65,000 | 1,330 | Estimate |
| Gemini 3.5 Flash-LiteGoogle | 1M | 65,000 | 1,330 | Estimate |
| Gemini 3.1 Flash-LiteGoogle | 1M | 65,000 | 1,330 | Estimate |
| Grok 4.7xAI | 500K | n/a | 1,330 | Estimate |
| DeepSeek FlashDeepSeek | 1M | 384,000 | 1,330 | Estimate |
| DeepSeek V4 ProDeepSeek | 1M | 384,000 | 1,330 | Estimate |
| Mistral Large 4Mistral | 1M | n/a | 1,330 | Estimate |
| Mistral Small 4Mistral | 256K | n/a | 1,330 | Estimate |
How many tokens is a word or a page
In English, one token is about 4 characters or three quarters of a word, so 1,000 tokens is roughly 750 words. Google gives a similar guide: 100 Gemini tokens is about 60 to 80 English words. A single-spaced page of around 500 words comes to about 670 tokens.
| Tokens | English words | Single-spaced pages |
|---|---|---|
| 1,000 | 750 | 2 |
| 4,000 | 3,000 | 6 |
| 8,000 | 6,000 | 12 |
| 32,000 | 24,000 | 48 |
| 128,000 | 96,000 | 192 |
| 200,000 | 150,000 | 300 |
| 1,000,000 | 750,000 | 1,500 |
Those ratios only hold for plain English. Code and JSON split on punctuation and use more tokens per character. Arabic, Hindi, Tamil and other scripts often need several tokens for a word that English would cover in one. Try the Arabic sample above to see the difference.
What a text token count leaves out
This tool counts the text you give it. A real API request can use more:
- Message formatting. Roles and message boundaries add a few tokens to each message.
- Tools and schemas. Function definitions and structured output schemas count as input.
- Images and files. These have their own counting rules, so a text counter cannot size them.
- Reasoning output. Thinking tokens are billed as output on most current models but do not appear in your prompt. The LLM API cost calculator has a field for them.
How to get an exact count from each provider
When you need a final number, send the full request to the provider's own counting endpoint.
| Provider | Method | Good to know |
|---|---|---|
| OpenAI | POST /v1/responses/input_tokens |
Includes roles, tools, images and files. |
| Anthropic | POST /v1/messages/count_tokens |
Anthropic calls the result an estimate that can differ slightly from the final usage. |
count_tokens |
Returns the input tokens before you send the request. |
LLM token counter FAQ
What is a token in an LLM?
A token is the unit of text a language model reads and writes. It can be a whole word, part of a word, a space or a punctuation mark. Providers bill API usage and set context window limits in tokens, not words.
Is this LLM token counter free and private?
Yes. It is free with no sign-up, and the counting runs inside your browser. Your text is not sent to Pixel or to any AI provider.
How do I count tokens for GPT-6?
Paste your text and choose a GPT-6 model. The tool uses o200k_base, the newest encoding OpenAI publishes. For a final number that includes roles and tools, use OpenAI's input token count endpoint.
Can I get an exact Claude or Gemini token count here?
No browser tool can, because Anthropic and Google do not publish their tokenizers. This counter gives an estimate with a range. For an exact figure, use the count_tokens method in each provider's API.
How many tokens is 1,000 words?
About 1,330 tokens in plain English on GPT models. Code, JSON and non-English text usually use more, and Claude 5.x uses about 30% more for the same text.
Does the token count include the model's reply?
No. It counts the text you paste, which is the input. The reply and any thinking tokens are billed separately as output.
What happens if my text is larger than the context window?
The API will reject the request or cut it off, depending on the provider. Split the text into chunks, summarise older content or retrieve only the relevant parts.
Which files can I upload?
Plain text formats such as TXT, Markdown, CSV, JSON, code and logs, up to 20 MB. The file is read in your browser and is not uploaded anywhere. PDF and Word files need converting to text first.
Does ChatGPT use the same tokens as the OpenAI API?
Yes, ChatGPT runs on the same GPT models, so text splits into tokens the same way. The difference is billing: ChatGPT plans have message limits, while the API charges per token. Use the GPT rows in this counter for either.