New blogMaking an AI Agent You Can Trust With Money

★ GPT · token counter

GPT Token Counter

OpenAI publishes its tokenizers through tiktoken, so this page counts your text in the browser with o200k_base, the encoding behind GPT-4o through GPT-5, and highlights every token. Nothing you paste leaves your machine.

  • Runs in your browser
  • No signup
306
Characters
54
Words
—
Tokens / word

Tokens per word uses the o200k_base count. Characters count emoji and accented letters as one each.

Tokens

…

✓ Exact

Counted with o200k_base, OpenAI's published tokenizer, in your browser.

Context window used

—

1.05M tokens window on GPT-6.1 Sol.

Input cost per call

—

Per 1,000 calls

—

Every model, same text

ModelTokensAccuracyInput / call
Claude Fable 5.1Anthropic…≈ Estimate—
Claude Opus 5.5Anthropic…≈ Estimate—
Claude Sonnet 5.5Anthropic…≈ Estimate—
Claude Haiku 5.5Anthropic…≈ Estimate—
GPT-6 AstraOpenAI…✓ Exact—
GPT-6.1 SolOpenAI…✓ Exact—
GPT-6 LunaOpenAI…✓ Exact—
Gemini 4 ArgonGoogle77≈ Estimate$0.00015
Gemini 3.8 FlashGoogle77≈ Estimate$0.00006
Gemini 3.1 Flash-LiteGoogle77≈ Estimate$0.00002
Mistral Large 4Mistral…≈ Estimate—
Mistral Small 4Mistral…≈ Estimate—
DeepSeek V4.1 FlashDeepSeek92≈ Estimate$0.00003
DeepSeek V4 ProDeepSeek92≈ Estimate$0.00012
Llama (open weights)Meta…≈ Estimate—

OpenAI rows use o200k_base, exact for that tokenizer. tiktoken hasn't mapped GPT-6 model names yet, so OpenAI hasn't confirmed GPT-6 uses it. Input cost is list price for your text alone, before system prompts, caching or output.

See the tokens

o200k_base

Loading the tokenizer…

Your tokens on GPT-6.1 Sol.

Prompts eating your context window? I build RAG and prompt pipelines that use a fraction of the tokens.

Shrink my prompts
01

How GPT tokenizes

OpenAI models use byte-pair encoding (BPE): text is split into chunks from a fixed vocabulary, and common words become single tokens while rare words break into pieces. o200k_base has a vocabulary of about 200,000 tokens.

tiktoken's model table maps GPT-4o and later models up to GPT-5 to o200k_base. At the time of writing, GPT-6 model names aren't in tiktoken's table yet (see openai/tiktoken issue #608), so for GPT-6 the o200k_base count is the closest published tokenizer, not a confirmed match.

02

Exact or estimate?

Exact for o200k_base. The count comes from the tokenizer itself, running in your browser.

For GPT-6 models, the count is exact for o200k_base but OpenAI hasn't confirmed GPT-6 uses that encoding. Check the usage field on a real API response if you need the billed number.

03

Current GPT models

Context windows and input prices from the pricing data used across these tools.

GPT models
ModelContext windowInput / 1M
GPT-6 Astra1.05M tokens$10
GPT-6.1 Sol1.05M tokens$2
GPT-6 Luna1.05M tokens$0.10
04

Quirks worth knowing

  • OpenAI's rule of thumb for English is about 4 characters, or three-quarters of a word, per token. Other languages usually need more tokens per character.
  • Leading spaces are part of tokens: " hello" and "hello" are different tokens.
  • Chat requests add a few tokens of message framing per message, on top of your text.

Sources: OpenAI Help: What are tokens and how to count them? · OpenAI Cookbook: How to count tokens with tiktoken · openai/tiktoken issue #608: Update for gpt-6 models

05

Questions people actually ask

Which tokenizer does this use for GPT?
o200k_base, through js-tiktoken. It's the encoding tiktoken maps to GPT-4o and later models up to GPT-5.
Is the count exact for GPT-6?
It's exact for o200k_base. tiktoken hasn't mapped GPT-6 model names yet, so OpenAI hasn't confirmed GPT-6 uses o200k_base. The usage field on an API response is the billed number.
How many tokens is 1,000 words?
OpenAI's rule of thumb is about 100 tokens per 75 English words, so roughly 1,300 tokens. Paste your text to get the real number.
Which counts on this page are exact?
OpenAI rows are exact for o200k_base, OpenAI's published tokenizer, counted in your browser. Gemini rows are exact when this site's server has a Gemini key and Google's countTokens endpoint answers. Claude, Llama, DeepSeek and Mistral rows are estimates, and each says how it was made.
Is my text sent anywhere?
The o200k_base count runs entirely in your browser. Only if you edit the text (or ask for it) is the text sent to Google's countTokens endpoint through this site's server for exact Gemini counts, and nothing is stored or logged here.
06

Count by model family

07

More from the workbench

Fine print

Tools: on the house.
Engineer: by the hour.

Counting tokens was free. Spending fewer of them is a project.

I'm Himanshu, an AI and full-stack engineer. I build MVPs, AI agents and the growth plumbing around them for early-stage startups.