MockFoxAdvertise

GPT Token Counter

Updated Free mock REST & WebSocket APIs

Get the exact number of tokens your text uses in OpenAI's GPT models, with an option to include chat-message overhead, and see how much of each model's context window it fills and what it costs to send.

Paste, type, or drop a file onto the box.
GPT tokens (o200k)
≈69
loading tokenizer…
Characters
260
260 bytes UTF-8
Words
45
1.53 tokens / word
Lines
3
3.77 chars / token
OpenAI o200k_baseestimate
≈69
GPT-6, GPT-5.x, GPT-4.1, GPT-4o, o3, o4-mini
OpenAI cl100k_baseestimate
≈72
GPT-4, GPT-3.5 Turbo, text-embedding-3

Tokens, context window and input cost by model

ModelTokensContext usedInput cost
GPT-6 Astra
OpenAI
≈69
<0.01% of 1.05M
$0.00069
GPT-6.1 Sol
OpenAI
≈69
<0.01% of 1.05M
$0.00014
GPT-6 Sol
OpenAI
≈69
<0.01% of 1.05M
$0.00014
GPT-6 Luna
OpenAI
≈69
<0.01% of 1.05M
$6.9e-6
GPT-5.6 Sol
OpenAI
≈69
<0.01% of 1.05M
$0.00028
GPT-5.6 Terra
OpenAI
≈69
<0.01% of 1.05M
$0.00014
GPT-5.6 Luna
OpenAI
≈69
<0.01% of 1.05M
$1.4e-5
GPT-5.5
OpenAI
≈69
<0.01% of 1.05M
$0.00034
GPT-5.4
OpenAI
≈69
<0.01% of 1.05M
$0.00017
GPT-5.4 mini
OpenAI
≈69
0.02% of 400K
$5.2e-5
GPT-5.4 nano
OpenAI
≈69
0.02% of 400K
$1.4e-5
GPT-5
OpenAI
≈69
0.02% of 400K
$8.6e-5
GPT-5 mini
OpenAI
≈69
0.02% of 400K
$1.7e-5
GPT-5 nano
OpenAI
≈69
0.02% of 400K
$3.5e-6
GPT-4.1
OpenAI
≈69
<0.01% of 1.05M
$0.00014
GPT-4.1 mini
OpenAI
≈69
<0.01% of 1.05M
$2.8e-5
GPT-4o
OpenAI
≈69
0.05% of 128K
$0.00017
GPT-4o mini
OpenAI
≈69
0.05% of 128K
$1.0e-5
o3
OpenAI
≈69
0.03% of 200K
$0.00014
o4-mini
OpenAI
≈69
0.03% of 200K
$7.6e-5
gpt-oss-120b
OpenAI · Groq
≈69
0.05% of 128K
$1.0e-5
gpt-oss-20b
OpenAI · Groq
≈69
0.05% of 128K
$5.2e-6

Prices checked on 2026-10-18 from each provider's official pricing page (standard tier, USD per 1M tokens). Prices change often — verify before you budget.

OpenAI counts are exact (tiktoken o200k_base / cl100k_base). Claude, Gemini, Llama, Mistral, DeepSeek and Grok don't publish a browser tokenizer, so those are estimates calibrated against o200k — exact counts: Claude count_tokens API, Gemini countTokens.

🔒 Runs in your browser — your text is never uploaded or sent to any AI provider.

How to count GPT tokens

  1. Paste the prompt or message you plan to send.
  2. Keep “Count as one chat message” on to include the ChatML framing tokens OpenAI adds to each message.
  3. Compare the GPT models in the table: token count, % of context used and the input cost of this text.

How chat messages are counted

For chat-style requests, OpenAI wraps each message in special tokens. The OpenAI cookbook's counting recipe adds 3 tokens per message plus the role name (1 token) and 3 tokens to prime the assistant's reply:

tokens = Σ (len(encode(content)) + 3 + 1)  +  3
# one user message of 50 tokens → 50 + 4 + 3 = 57

Tool/function definitions are serialized into the prompt too and can add hundreds of tokens. Reasoning models (o-series, GPT-5.x thinking) also bill hidden reasoning tokens as output.

GPT models: price and context

ModelInputCached inputOutputContext
GPT-6 Astra
gpt-6-astra
$10$1$501.05M
GPT-6.1 Sol
gpt-6.1-sol
$2$0.10$101.05M
GPT-6 Sol
gpt-6-sol
$2$0.20$101.05M
GPT-6 Luna
gpt-6-luna
$0.10$0.01$0.501.05M
GPT-5.6 Sol
gpt-5.6-sol
$4$0.40$201.05M
GPT-5.6 Terra
gpt-5.6-terra
$2$0.20$121.05M
GPT-5.6 Luna
gpt-5.6-luna
$0.20$0.02$1.201.05M
GPT-5.5
gpt-5.5
$5$0.50$301.05M
GPT-5.4
gpt-5.4
$2.50$0.25$151.05M
GPT-5.4 mini
gpt-5.4-mini
$0.75$0.075$4.50400K
GPT-5.4 nano
gpt-5.4-nano
$0.20$0.02$1.25400K
GPT-5
gpt-5
$1.25$0.125$10400K
GPT-5 mini
gpt-5-mini
$0.25$0.025$2400K
GPT-5 nano
gpt-5-nano
$0.05$0.005$0.40400K
GPT-4.1
gpt-4.1
$2$0.50$81.05M
GPT-4.1 mini
gpt-4.1-mini
$0.40$0.10$1.601.05M
GPT-4o
gpt-4o
$2.50$1.25$10128K
GPT-4o mini
gpt-4o-mini
$0.15$0.075$0.60128K
o3
o3
$2$0.50$8200K
o4-mini
o4-mini
$1.10$0.275$4.40200K
gpt-oss-120b
gpt-oss-120b
$0.15—$0.60128K
gpt-oss-20b
gpt-oss-20b
$0.075—$0.30128K

USD per 1M tokens, standard tier, checked 2026-10-18. Source: OpenAI pricing.

Fit more into the context window

  • Minify JSON you paste into prompts — indentation and newlines are tokens.
  • Prefer o200k models for non-English text; they need fewer tokens than cl100k.
  • Keep the stable part of the prompt first so it hits the prompt cache (cached input is 50–95% cheaper).

Related tools

Frequently asked questions

Is my text sent to OpenAI, Anthropic or anyone else?

No. Everything runs in your browser: the tokenizer files are downloaded once and your text never leaves your device. Nothing is logged or stored.

How many tokens can GPT-5 handle?

GPT-5, GPT-5 mini and nano have a 400K-token context window (up to 272K input, 128K output). GPT-5.4, GPT-5.5, GPT-5.6 and GPT-6 models offer about 1.05M tokens, with long-context rates above 272K input tokens.

Is the count exact for GPT-4o and GPT-4.1?

Yes. Both use o200k_base, which this page runs with tiktoken's official ranks. GPT-4 and GPT-3.5 Turbo use cl100k_base, also shown.

Do images count as tokens?

Yes, but they are priced by resolution, not by text tokens, so they aren't included here. See OpenAI's vision pricing for the per-image formula.

Your business here? Sponsor this tool from $16/week. See placements