Free token counter for Claude, GPT and Gemini

The Token Counter shows how many tokens your text uses in GPT, Claude, Gemini, DeepSeek, Llama and more, how much of each context window it fills, and what it costs to send. Counting runs in your browser; nothing is uploaded.

Your text0 characters•0 words•0 lines
Token count, context-window use and input cost for each model
ModelTokensContext window usedInput cost
GPT-4oOpenAI0Exact
0.00% of 128K
$0.00
GPT-4o miniOpenAI0Exact
0.00% of 128K
$0.00
GPT-4 / GPT-3.5OpenAI0Exact——
Claude Opus 5.5Anthropic~0Estimate
0.00% of 1M
$0.00
Claude Sonnet 5.5Anthropic~0Estimate
0.00% of 1M
$0.00
Claude Haiku 4.5Anthropic~0Estimate
0.00% of 200K
$0.00
Gemini 3.6 FlashGoogle~0Estimate
0.00% of 1.05M
$0.00
Gemini 3.1 ProGoogle~0Estimate
0.00% of 1.05M
$0.00
DeepSeek V4-FlashDeepSeek~0Estimate
0.00% of 1M
$0.00
Llama 3 / 4Meta~0Estimate——
Mistral LargeMistral~0Estimate——
GrokxAI~0Estimate——

OpenAI counts use OpenAI's published tokenizers and are exact. Other providers don't publish a tokenizer that runs in a browser, so their counts (marked ~) are scaled from the GPT-4o count and typically land within 10–15% for English text; code and non-English text can drift further. Cost is one input-only call at list prices as of September 2026; "—" means no price on file.

Models and tokenizers supported

Every model below is counted on each paste. “Exact” means the count comes from the provider's published tokenizer; “Estimate” means it is scaled from the GPT-4o count.

ModelProviderTokenizerAccuracy
GPT-4oOpenAIo200k_baseExact
GPT-4o miniOpenAIo200k_baseExact
GPT-4 / GPT-3.5OpenAIcl100k_baseExact
Claude Opus 5.5AnthropicClaude tokenizerEstimate
Claude Sonnet 5.5AnthropicClaude tokenizerEstimate
Claude Haiku 4.5AnthropicClaude tokenizerEstimate
Gemini 3.6 FlashGoogleGemini tokenizerEstimate
Gemini 3.1 ProGoogleGemini tokenizerEstimate
DeepSeek V4-FlashDeepSeekDeepSeek tokenizerEstimate
Llama 3 / 4MetaLlama tokenizerEstimate
Mistral LargeMistralMistral tokenizerEstimate
GrokxAIGrok tokenizerEstimate

What the Token Counter does

The Token Counter is a free token counter for Claude, GPT, Gemini and other models. Paste a prompt, a document or a block of code and it shows the token count for each model side by side, how much of the model's context window the text fills and what it costs to send once as input. It runs in your browser, so your text is not uploaded.

A token is a chunk of text a model reads, roughly three-quarters of a word in English. Each provider splits text with its own tokenizer, so one text gives a different count in each model. OpenAI publishes its tokenizers, so the GPT counts here are exact. Anthropic, Google and the other providers do not publish a tokenizer that runs in a browser, so the Claude, Gemini, DeepSeek, Llama, Mistral and Grok counts are estimates scaled from the GPT-4o count and are marked with a ~. To shorten a prompt that is too long, use the token optimizer. To see what a rewrite saves in money, use the token cost calculator.

How to use the Token Counter

  1. 1

    Paste your text

    Add a prompt, a system message, an article or code. The counts update as you type.

  2. 2

    Read the counts

    Each model shows its token count and whether it is exact or an estimate, next to the characters, words and lines in your text.

  3. 3

    Check the context window

    The bar shows how much of the model's context window the text takes up, so you know before you hit a limit.

  4. 4

    Compare cost

    Where a price is on file, you see what sending the text once as input costs. Shorten it with the token optimizer if it is too long.

Example: before and after

Before

Summarise the attached quarterly report in three bullet points for the board.

After

GPT-4o: 15 tokens (exact)
Claude Sonnet 5.5: about 18 tokens (estimate)
Gemini 3.6 Flash: about 16 tokens (estimate)

The same sentence is a different length in each model. For short text the gap is a token or two; for a long document it can be thousands.

Who the Token Counter is for

  • Developers

    Check a prompt fits the context window and estimate API cost before sending it.

  • Prompt engineers

    See the token weight of each version while you tighten a prompt.

  • Teams on a budget

    Compare what the same prompt costs on different models.

  • Writers and researchers

    Find out whether a long document fits in one chat.

Token Counter FAQ

How do I count tokens for Claude?

Paste your text and read the Claude rows. Anthropic does not publish a tokenizer that runs in a browser, so these counts are estimates (marked ~): the GPT-4o count scaled up by about 20%, which is how Claude usually compares on English text. For exact figures to budget against, use Anthropic's own token counting API.

How many tokens is 1,000 words?

As a rough rule, about 1,300 tokens for plain English prose in GPT-4o, or roughly three-quarters of a word per token. This is approximate: code, tables, numbers and non-English text use more tokens per word, and Claude counts higher than GPT. Paste your own text for a real count.

Why do Claude and GPT token counts differ?

Each model splits text into tokens with its own vocabulary, so the same words can come out as more or fewer tokens. Claude usually counts a little higher than GPT-4o on English text.

Why are some counts marked as estimates?

Anthropic, Google and most other providers do not publish a tokenizer that can run in a browser. Their counts are scaled from the exact GPT-4o count and typically land within 10 to 15 percent for English text; code and other languages can drift further.

Is this an OpenAI tokenizer alternative?

It uses OpenAI's published tokenizers (o200k_base for GPT-4o and newer, cl100k_base for GPT-4 and GPT-3.5), so GPT counts are exact. It also shows other providers' counts, context-window use and input cost beside them on one page.

Does the counter send my text anywhere?

No. Counting runs in your browser, so the text you paste is not uploaded.

Is the token counter free?

Yes, with no sign-in and no daily limit.

Prompts to try it on

Browse the Prompt Cookbook
RAG & Knowledge Retrieval

AI Prompt to Make a RAG Assistant Say 'I Don't Know' When Context Is Missing

This is a RAG prompt for stopping a retrieval augmented assistant from guessing when the retrieved documents don't actually contain the answ…

ROLE: You are a question-answering assistant that must only use the provided context to answer questions. You must never use outside knowledge, even if you know the answer.

CONTEXT:
[PASTE RETRIEVED DOCUMENT CHUNKS HERE]

QUESTION: [USER'S QUESTION]

INSTRUCTIONS:
1. Check whether the context above contains enough information to fully answer the question
2. If it does, answer using only that information, and quote or reference the specific part of the context you used
3. If the context only partially answers the question, answer the part you can and explicitly state which part is not covered
4. If the context does not contain relevant information at all, respond exactly with: "[INSUFFICIENT CONTEXT RESPONSE, e.g. I don't have enough information in the provided documents to answer this.]"
5. Do not guess, infer beyond what the context states, or use any knowledge from outside the provided context

CONSTRAINTS:
- [ANY ADDITIONAL CONSTRAINT, e.g. keep answers under 150 words, cite chunk numbers if provided]

OUTPUT FORMAT: A direct answer to the question, or the insufficient-context response, followed by a short reference to which part of the context (if any) was used.

Make this prompt yours

React Prompt Recipes

AI Prompt to Turn a Design Screenshot into a React Component

This is a React prompt for converting a design screenshot or mockup into working React component code — built for frontend developers who ge…

ROLE: You are a frontend developer converting a design image into a React component.

CONTEXT: I'm attaching a design screenshot/mockup. Tech stack: [REACT VERSION, STYLING APPROACH e.g. Tailwind/CSS Modules/styled-components, COMPONENT LIBRARY IF ANY]

TASK:
1. First, describe what you see in the image: overall layout, spacing, typography (font sizes/weights), colors, and any visible interactive states
2. Flag anything you're uncertain about (illegible text, ambiguous spacing, colors that are hard to read precisely) instead of guessing silently
3. Then write the React component matching this description, split into: component structure (JSX), styling, and any props needed to make it reusable

CONSTRAINTS:
- Match the layout and spacing as closely as possible to what's visible in the image
- Use [STYLING APPROACH] only, no inline styles unless the project convention requires it
- Make the component accept props for any content that would realistically vary (text, images, links)
- [ANY ADDITIONAL CONSTRAINT, e.g. must be accessible, must support dark mode]

OUTPUT FORMAT:
1. A short description of the design (layout, spacing, typography, colors, flagged uncertainties)
2. The complete component code in a fenced code block
3. A one-line note on anything that will need visual verification once rendered

Make this prompt yours

Data Analysis & Data Science

ChatGPT Prompt for Exploratory Data Analysis on a New Dataset

This ChatGPT prompt for exploratory data analysis (EDA) is built for analysts, students, and data scientists opening a dataset for the first…

Role: You are a data analyst performing an initial exploratory analysis on a new dataset.

Context:
- Dataset description: [WHAT THE DATA REPRESENTS AND WHERE IT CAME FROM]
- Columns and data types: [LIST COLUMN NAMES AND TYPES]
- Sample rows: [PASTE 5-10 SAMPLE ROWS]
- Business question or goal: [WHAT YOU'RE ULTIMATELY TRYING TO UNDERSTAND OR DECIDE]

Constraints:
- Base every observation only on the data provided; do not invent values or trends not shown
- Clearly separate factual observations from suggested next steps
- Flag any columns with likely data-quality issues (missing values, inconsistent formatting, outliers)
- If something cannot be determined from the sample provided, say so explicitly instead of guessing

Output format:
1. Dataset overview (shape, column types, general structure)
2. Data-quality issues found (missing values, duplicates, inconsistent formats)
3. Key distributions and notable patterns
4. Three to five follow-up questions worth investigating further

Make this prompt yours

Further reading: Reduce Claude Code Token Usage: 9 Ways