Your text is never sent to a server. It is counted entirely in your browser and not stored anywhere.

AI Token Counter

Paste a prompt or document to see how many tokens it uses on GPT, Claude, Gemini, Llama, DeepSeek, Mistral and Qwen models, how much of each context window it fills, and what it would cost through the API. Tokens are counted in your browser with each model’s tokenizer; your text is never sent to a server.

0 characters · GPT (o200k) 0 tokens · Claude est. 0 tokens
Choose models to compare

Models marked with a size download their tokenizer file from Hugging Face once when you select them (your text is not sent).

Loading the model list…

Start typing and token counts and costs for each model appear here.

Model Tokens Context Input cost Output cost Total

Costs use standard USD list prices (no batch or caching discounts) multiplied by the number of requests. Context is the share of the context window taken by input plus expected output. Exact same tokenizer, Approx. closely related tokenizer, Estimate no public tokenizer, range from multipliers.

    What is a token?

    Language models don’t read characters or words directly. A tokenizer first splits text into tokens: common English words are often a single token, while rare words, numbers, code symbols and non-Latin scripts are broken into several pieces. A rough rule of thumb for English is about four characters, or three quarters of a word, per token on modern tokenizers.

    Tokens are the unit for everything that matters when you build with an LLM API: what you pay, how much text fits in one request (the context window), and how long an answer can be. Need plain character and word counts instead? Use the character counter.

    Why token counts differ between models

    Each model family trains its own tokenizer, usually a byte-pair encoding (BPE) or SentencePiece vocabulary built from its training data. Vocabulary size and the languages it saw decide how efficiently text is packed, so the same paragraph can be a few percent apart in English and far more apart in other languages or code.

    TokenizerUsed byVocabularyAccuracy here
    o200k_baseGPT-4o, GPT-4.1, o-series, GPT-5.x~200KExact (GPT-6: approximate)
    cl100k_baseGPT-4, GPT-3.5~100KExact
    Llama 4Llama 4 Maverick, Scout201,135Exact
    Llama 3Llama 3.1, 3.3128,256Exact
    Gemma (SentencePiece)Gemma 3 and 4 (the Gemma 3 report says it shares Gemini 2.0’s tokenizer)262,144Gemini: approximate
    Qwen3.8Open-weight Qwen3.8; Qwen API models are related248,077Qwen API: approximate
    DeepSeek V4DeepSeek V4, V4.1129,280Exact
    Mistral TekkenMistral Medium 3.5, Small 4, Large 3131,072Exact (Large 4: approximate)
    ClaudeAll Claude modelsNot publicEstimate (see below)

    Vocabulary sizes were read from each tokenizer file, including special tokens (October 19, 2026).

    The same sentence in four languages

    We wrote one sentence in English and translated it into Spanish, Japanese and Korean, then counted it with the real tokenizers (special tokens excluded). English is the cheapest everywhere; other languages cost up to about twice as much on older tokenizers, and the gap narrows on newer, larger vocabularies.

    English (148 characters): “AI models process text by splitting it into small pieces called tokens. Even with the same meaning, the number of tokens varies greatly by language.”

    TokenizerEnglishSpanishJapaneseKorean
    OpenAI cl100k_base (GPT-4, 3.5)28436165
    OpenAI o200k_base (GPT-5.x)28364538
    Llama 3.1 / 3.328434241
    Llama 428353429
    DeepSeek V428413643
    Mistral Tekken28364134
    Qwen3.828362735
    Gemma 4 (Gemini approximation)28342736

    Counted with tiktoken and Hugging Face tokenizers and cross-checked against this counter on October 19, 2026. One short sentence is only an illustration, but the pattern is typical: if you serve users in several languages, budget tokens per language rather than per character. Anthropic notes that Claude’s tokenizer produces many more tokens than OpenAI’s for non-English text and code, so leave extra headroom there.

    How to estimate API cost

    Providers bill input (prompt) tokens and output (completion) tokens separately, each at a price per million tokens.

    Cost = input tokens × input price ÷ 1,000,000 + output tokens × output price ÷ 1,000,000

    Context windows

    The context window is the most tokens a model can handle in one request, input and output (and, on some models, reasoning) combined. Most current flagship models offer roughly one million tokens; Llama 4 Scout advertises 10 million, Mistral Medium 3.5 and Small 4 have 256K, and GPT-5.4 mini has 400K with at most 272K of input. When the Context column approaches 100%, split the input or pick a model with a larger window, and remember that longer prompts are also slower and more expensive.

    Claude counts are estimates

    Anthropic has not published a local tokenizer for current Claude models. Exact counts are only available from the authenticated token counting API (POST /v1/messages/count_tokens), which needs an API key and would mean sending your text away, so this page doesn’t call it. Instead it estimates a range from two facts in Anthropic’s documentation:

    The counter multiplies the o200k count by the ranges below, weighted by the share of non-Latin letters and code-like lines in your text. The multipliers are this site’s own assumptions built on those facts, not official figures.

    Kind of textMultiplier on o200k
    English and other Latin-script prose1.15–1.6×
    Code1.3–2.0×
    Korean, Japanese, Chinese and other non-Latin scripts1.3–2.5×

    Costs for Claude are shown as a range too. Budget with the upper end, and use the count_tokens API when you need the exact number.

    API price list

    Standard prices from each provider’s official pricing page, in USD per million tokens, without batch or caching discounts. Prices change often, so confirm on the provider’s page before you commit.

    ModelInputOutputContextNotes
    OpenAI
    GPT-6 Astra$10$501.05MThe GPT-6 tokenizer is not yet published in tiktoken, so o200k_base is used as an approximation. Requests over 272K input tokens are billed at 2x input and 1.5x output for the whole request.
    GPT-6.1 Sol$2$101.05MThe GPT-6 tokenizer is not yet published in tiktoken, so o200k_base is used as an approximation. Requests over 272K input tokens are billed at 2x input and 1.5x output for the whole request.
    GPT-6 Luna$0.10$0.501.05MThe GPT-6 tokenizer is not yet published in tiktoken, so o200k_base is used as an approximation. Requests over 272K input tokens are billed at 2x input and 1.5x output for the whole request.
    GPT-5.5$5$301.05MRequests over 272K input tokens are billed at 2x input and 1.5x output for the whole request.
    GPT-5.4 mini$0.75$4.50400K
    GPT-3.5 Turbo$0.50$1.5016KLegacy model, included to compare the older cl100k_base tokenizer (GPT-4 / GPT-3.5).
    Anthropic
    Claude Fable 5.1$10$501M
    Claude Opus 5.5$4$201M
    Claude Sonnet 5.5$2$101M
    Claude Haiku 5.5$0.10$0.501MRequests whose prompt exceeds 100K tokens are billed at $0.50 input / $2.50 output.
    Claude Opus 5$5$251M
    Claude Sonnet 5$2$101M
    Google
    Gemini 4 Argon$2$101.05MApproximated with the Gemma tokenizer. Scheduled to rise to $4 / $20 on December 1, 2026.
    Gemini 3.8 Flash$0.75$3.751.05MApproximated with the Gemma tokenizer. Scheduled to rise to $1.50 / $7.50 on January 1, 2027.
    Gemini 3.5 Flash-Lite$0.30$2.501.05MApproximated with the Gemma tokenizer.
    Gemini 3.1 Pro (Preview)$2$121.05MApproximated with the Gemma tokenizer. Prompts over 200K tokens: $4 / $18.
    Meta
    Llama 4 MaverickVaries by host1MLlama has no single list price; it depends on the host (check your provider).
    Llama 4 ScoutVaries by host10MLlama has no single list price; it depends on the host (check your provider).
    Llama 3.3 70BVaries by host128KLlama has no single list price; it depends on the host (check your provider).
    DeepSeek
    DeepSeek V4.1 Flash$0.30$1.201MAPI model deepseek-flash runs DeepSeek-V4.1-Flash-1017. Peak-hour price (01:00-04:00 and 06:00-10:00 UTC, weekdays); off-peak is half. Input is cache-miss.
    DeepSeek V4 Pro$1.32$3.961MAPI model deepseek-v4-pro runs DeepSeek-V4-Pro-0813. Peak-hour price (01:00-04:00 and 06:00-10:00 UTC, weekdays); off-peak is half. Input is cache-miss.
    Mistral AI
    Mistral Large 4$0.68$2.091MPublic preview. Sale price; list price is $1.36 / $4.18 (no end date given). Approximated with the Mistral Tekken tokenizer.
    Mistral Medium 3.5$1.50$7.50256K
    Mistral Small 4$0.15$0.60256K
    Qwen (Alibaba Cloud)
    Qwen3.8 Max$2$61MApproximated with the open-weight Qwen3.8 tokenizer. International (Singapore) region price.
    Qwen3.7 Plus$0.40$1.601MApproximated with the open-weight Qwen3.8 tokenizer. International (Singapore) region price. Over 256K input tokens: $1.20 / $4.80.
    Qwen3.8 Flash$0.15$0.471MApproximated with the open-weight Qwen3.8 tokenizer. International (Singapore) region price.

    Sources (official pricing pages, checked 2026-10-19):

    FAQ

    Is my text uploaded?

    No. Tokenization runs in your browser. The page downloads only the price list and tokenizer files (from the jsDelivr CDN and Hugging Face); the text you type is never sent to our server or to any AI provider, and it isn’t stored. Only your model selection is remembered in this browser for next time.

    Why doesn’t this match the usage reported by the API?

    A real request adds chat formatting tokens (roles and separators), the system prompt, tool definitions, images and reasoning tokens. This counter measures the text itself, so billed usage is usually somewhat higher.

    What do Exact, Approx. and Estimate mean?

    Exact means the count comes from the same public tokenizer file the model uses. Approx. means the model’s own tokenizer isn’t published, so a closely related one is used (Gemma for Gemini, open-weight Qwen3.8 for Qwen API models, o200k_base for GPT-6); treat these as close approximations, not guaranteed matches. Estimate is used for Claude, where no comparable public tokenizer exists.

    Why do Llama, DeepSeek, Mistral and Qwen take a moment to load?

    Their tokenizer files (about 6–21 MB) are downloaded from Hugging Face the first time you select them, then served from your browser cache. On a metered connection, select only the models you need.