Skip to content
AI Dev Toolkit.
Esc
  • AI Token CounterCount tokens for GPT, Claude, Gemini, DeepSeek, Qwen and more.Tool
  • LLM API Cost CalculatorEstimate per-request, daily and monthly API costs.Tool
  • AI Model ComparisonCompare prices, context windows and features across models.Tool
  • AI Model Pricing PagesSpecs, real costs and cheaper alternatives for popular models.Tool
  • Context Window CheckerSee whether your text fits each model's context window.Tool
  • Subscription vs API CalculatorFind out whether a chat plan or the API is cheaper for you.Tool
  • GPU / VRAM CalculatorCheck how much VRAM a local model needs and which GPUs fit.Tool
  • Claude Code Error DatabaseExact Claude Code error messages with tested fixes.Tool

Tokens & Costs

AI token counter for GPT, Claude, Gemini and more

Count the tokens in any text for up to five models at once, see how each tokenizer splits it, and what it costs. Counting runs in your browser.

0 characters · 0 words

Counting runs in your browser. Your text isn’t sent anywhere unless you ask a provider for an official count.

Tokens by model

  • GPT-6.1 Sol

    OpenAI

    —

    loading…

    Unconfirmed OpenAI hasn’t said which tokenizer GPT-6.1 Sol uses. This count uses o200k_base, the tokenizer of GPT-4o through GPT-5.x.

  • Claude Sonnet 5.5

    Anthropic

    —

    tokens

    No public count Anthropic doesn’t publish its tokenizer, but its free counting API gives the exact number. OpenAI’s tokenizer gives … for reference only; this model splits text differently.

    Free, uses your own API key. Sends this text to Anthropic.
  • Gemini 3.8 Flash

    Google

    —

    tokens

    No public count Google doesn’t publish its tokenizer, but its free counting API gives the exact number. OpenAI’s tokenizer gives … for reference only; this model splits text differently.

    Free, uses your own API key. Sends this text to Google.
  • DeepSeek V4.1 Flash

    DeepSeek

    —

    loading…

    Exact DeepSeek’s published tokenizer (DeepSeek V4.1 Flash), checked against the official library.

Prices per 1M tokens, updated daily

See how the text is split

Each coloured block is one token. Split characters such as some emoji span several.

Type or paste some text to see its tokens.

Steps

How to use the AI token counter

  1. Paste or type your text, or drop a text or code file onto the box.
  2. Read the token count for each model. Add models with the search box, up to five.
  3. Check the label under each count: “Exact” is the model’s own tokenizer; “Unconfirmed” and “No public count” explain what the number is.
  4. For Claude and Gemini models, click “Get the official count” and enter your own API key to get the provider’s number.
  5. Scroll down to see how the text is split into tokens, and follow “Estimate monthly cost” to price a whole workload.

Method

How it works

Language models don’t read letters or words. They read tokens: pieces of text from a fixed vocabulary, usually whole common words, parts of rarer words, punctuation and spaces. API prices, context windows and output limits are all measured in tokens, so knowing how many tokens a prompt or document uses tells you what it costs and whether it fits.

Every model family has its own tokenizer

A tokenizer is built by learning which pieces of text appear most often in the training data. Different companies use different data and vocabulary sizes, so the same text produces different counts. For plain English the differences are small, but code, numbers and non-English text can vary a lot: see the examples below. That is why this tool counts each model separately instead of using one rule of thumb.

Where the counts come from

OpenAI models use the tokenizers OpenAI publishes in its tiktoken library. The tool runs the same encodings in your browser through the open-source gpt-tokenizer library, picks the encoding using OpenAI’s own model-to-encoding mapping, and is tested to give identical results to tiktoken. OpenAI hasn’t published which tokenizer the GPT-6 family uses, so those counts use o200k_base, the tokenizer of GPT-4o through GPT-5.x, and are labelled “Unconfirmed”.

Open-weight models such as DeepSeek, Qwen and Mistral publish their tokenizer files. When you pick such a model, the tool downloads its tokenizer from this site, pinned to an exact version and checked against the publisher’s hash, then runs them with Hugging Face’s tokenizers library. They are tested against the official implementation on thousands of samples in many languages, with code and emoji. Where a model’s tokenizer isn’t available here yet, the tool says so instead of guessing.

Claude and Gemini tokenizers aren’t public. Rather than show an estimate dressed up as a count, the tool shows OpenAI’s count clearly marked “for reference only” and offers the provider’s own counting API, which is free, with your API key. Your key and text go directly from your browser to Anthropic or Google. Anthropic describes its count as an estimate that can differ slightly from a real request.

Tokens, words and cost

As a rough guide for English, one token is about four characters or three-quarters of a word, so 1,000 words is around 1,300 tokens. Each row also shows what the text would cost as input (in a prompt) and as output (if a model wrote it), at the model’s current list price. Output usually costs several times more. For a whole workload with daily volumes, caching and batch pricing, use the LLM API cost calculator.

The count covers only the text you enter. A real request adds a few tokens per message for the chat format, plus any system prompt, tool definitions and images. If you are checking whether a long document fits a model, leave room for those and for the reply.

Examples

Worked examples

The same text, counted by five tokenizers

TextGPT-4o to GPT-5.xGPT-4, GPT-3.5DeepSeek V4.1Qwen 3.8Mistral Small 4
An English sentenceThe quick brown fox jumps over the lazy dog. Tokenizers split text into pieces that models read.2020202020
Python codedef fibonacci(n: int) -> int: if n < 2: return n return fibonacci(n - 1) + fibonacci(n - 2) 3535353838
JSON{"user": {"id": 4821, "name": "Ayesha Khan", "roles": ["admin", "editor"], "active": true}}3233333535
An Urdu sentenceمصنوعی ذہانت کے ماڈل متن کو ٹوکن میں تقسیم کرتے ہیں۔1953272321

Counts from each model’s own tokenizer, without chat formatting. English and code come out almost the same everywhere; the Urdu sentence varies from 19 to 53 tokens.

FAQ

Frequently asked questions

How many words is 1,000 tokens?

For ordinary English text, about 750 words: OpenAI’s rule of thumb is that one token is roughly four characters or three-quarters of a word. Code, numbers and other languages usually need more tokens per word, so count your real text when the number matters.

Is this token count exact?

It depends on the model, and the tool tells you which applies. Counts marked “Exact” come from the model’s own tokenizer, tested against the official implementation. GPT-6 models are marked “Unconfirmed” because OpenAI hasn’t said which tokenizer they use. For models whose tokenizer isn’t public, such as Claude and Gemini, there is no exact count without asking the provider, so the tool offers the provider’s official count with your own key.

How do I count tokens for Claude?

Anthropic doesn’t publish the tokenizer for current Claude models, so no website can count Claude tokens exactly on its own. Click “Get the official count from Anthropic” and enter your Anthropic API key: the text goes straight from your browser to Anthropic’s free token counting endpoint. Anthropic notes that the count can differ slightly from what a real request uses.

How do I count tokens for Gemini?

Google’s Python SDK can count Gemini tokens locally with an experimental tokenizer based on Gemma’s, but the official count comes from its countTokens API, which is free. Click “Get the official count from Google” and paste a Gemini API key from Google AI Studio; the request goes straight from your browser to Google.

Is my text or API key sent to this website?

No. Tokenizers run inside your browser, so your text stays on your device. The only time text leaves it is when you ask for an official count, and then it goes directly to that provider. Your key is kept in memory unless you tick “Remember on this device”. See the privacy policy for the details.

Why do different models give different token counts for the same text?

Each model family learns its own vocabulary of text pieces. A tokenizer trained on more code or more languages has longer pieces for them, so it needs fewer tokens. The Urdu sentence in the examples below takes 53 tokens with GPT-4’s tokenizer but 19 with GPT-4o’s.

Does the count include the chat format and system prompt?

No: it counts exactly the text you enter. A real API request adds a few tokens per message for formatting, plus whatever system prompt, tool definitions and images you send. Anthropic’s official count treats your text as one user message, so it includes a few tokens of that formatting.