OpenAI Token Counter

Paste text to count tokens and calculate API costs for any OpenAI model instantly.

  • Free
  • No account
  • Runs in your browser
  • Nothing uploaded
OpenAI Token CounterNothing uploaded
0 characters
o200k_base (exact)
Tokens0
Words0
Characters0
Context Used0%
Input cost:$0
Output cost:$0

GPT-5.6 Sol at Standard pricing: $5.00 input / $30.00 output per 1M tokens.1,050,000 token context window.

Runs entirely in your browser — your input is never uploaded, logged, or stored.Privacy policy

What is OpenAI Token Counter?

OpenAI prices every API call by the token — a sub-word unit their tokenizer splits your text into. The token count determines both what a request costs and whether it fits in the model's context window. This tool counts your text using o200k_base, the same tokenizer OpenAI uses for all current models, and shows the exact cost at that model's published rate.

The same text produces different token counts on different model families because each uses its own tokenizer vocabulary. However, all current OpenAI models (GPT-5.x, GPT-4.x, o-series) share the o200k_base encoding, so the token count is consistent across them — only the price changes.

It is for developers and prompt engineers who need to know exactly what a request will cost before calling the API: budgeting for batch jobs, checking whether a document fits, comparing model costs, or optimizing prompts for token efficiency. If you need to compare across vendors (OpenAI vs Claude vs Gemini), use the LLM Token Counter instead — this tool is OpenAI-only and uses a real encoding rather than an approximation.

The tool runs o200k_base, OpenAI's current tokenizer encoding, over your text. This is the same encoding used by GPT-5.6, GPT-5, GPT-4o, o3, and all other current OpenAI models — the count is exact, not an approximation.

Cost is calculated as: (token count ÷ 1,000,000) × model's per-million-token rate. The tool shows three pricing tiers: • Standard — normal API requests • Batch — 50% discount for non-urgent workloads processed within 24 hours • Flex — reduced rate for testing and development with lower priority

For models with long-context pricing (>128K tokens), the tool applies the appropriate rate based on your input length. Cached input pricing is also shown where applicable.

Current OpenAI model pricing (Standard tier), from OpenAI docs (18 August 2026)
 ModelInput $/MOutput $/MContextBest for
GPT-5.6 Sol$5.00$30.001MComplex professional work
GPT-5.6 Terra$2.00$12.001MBalanced intelligence & cost
GPT-5.6 Luna$0.20$1.201MCost-sensitive workloads
GPT-5.4$2.50$15.00272KGeneral-purpose flagship
GPT-5.4 Mini$0.75$4.50128KFast, affordable tasks
GPT-5$1.25$10.00128KPrevious-gen flagship
GPT-5 Mini$0.25$2.00128KBudget reasoning
GPT-4o$2.50$10.00128KMultimodal tasks
GPT-4o Mini$0.15$0.60128KHigh-volume, low-cost
o3$2.00$8.00200KComplex reasoning
o4-mini$1.10$4.40200KFast reasoning
o3 Pro$20.00$80.00200KExtended reasoning

Worked examples

  • 'The quick brown fox jumps over the lazy dog.' → 10 tokens on GPT-5.6 Sol, costing $0.000050 as input at Standard pricing.
  • A 4,000-character prompt → 801 tokens on GPT-5.6 Sol, costing $0.004005 as input or $0.024030 as output.
  • The same 4,000-character prompt on GPT-5.6 Luna → 801 tokens for $0.000160 as input — 25× cheaper than Sol.
  • A 5,001-token request on GPT-4o at Batch pricing → $0.006251 input, $0.025005 output — half the Standard rate.

How to use OpenAI Token Counter

  1. Paste or type the text you plan to send into the input box.
  2. Select the OpenAI model you are targeting from the dropdown.
  3. Choose the pricing tier: Standard, Batch, or Flex.
  4. Read the token count and the cost breakdown for input and output tokens.
  5. Use the copy buttons to grab the exact numbers for your calculations.

Common errors

  • Token count doesn't match your word count — expected. Tokens are sub-word units; a long word can be several tokens and a common word is usually one.
  • The count is the same for GPT-5.6 Sol and GPT-5.6 Luna — correct. All current OpenAI models share the o200k_base tokenizer; only the price differs.
  • Your API bill shows a slightly different number — this tool counts input tokens only. API calls also bill for output tokens (the model's response) and any tool calls.
  • A price looks out of date — OpenAI changes pricing without notice. The verification date is shown on the page; check developers.openai.com/api/docs/pricing before relying on it.
  • Very large pastes (100k+ characters) make the box sluggish — tokenizing in the browser is CPU-bound. Split the text and add the counts together.

FAQ

How accurate is this token count for OpenAI models?

Exact. The tool uses o200k_base, the same tokenizer OpenAI uses for all current models. This is not an approximation — it is the real encoding. The only caveat is that OpenAI may change tokenizers for future model releases.

Why are all OpenAI models showing the same token count?

Because they all use the same tokenizer (o200k_base). Unlike comparing across vendors (OpenAI vs Claude), all current OpenAI models share the same encoding, so the token count is identical — only the price per token changes.

What's the difference between Standard, Batch, and Flex pricing?

Standard is normal API pricing. Batch gives 50% off for non-urgent work processed within 24 hours. Flex offers reduced rates for testing and development with lower priority. All three use the same tokenizer and produce identical token counts.

Does this count output tokens too?

No — this tool counts input tokens (what you send to the API). Output tokens (what the model generates) are billed separately at a higher rate. The tool shows both rates so you can estimate total cost.

Is a token the same as a word?

No. A token averages roughly three-quarters of an English word, but that ratio is only an average. Punctuation, numbers, whitespace, code, and non-English text all tokenise differently, and a single long word can become several tokens.

Does this tool send my text anywhere?

No. Counting happens entirely in your browser using the o200k_base tokenizer. Nothing you paste is uploaded, logged, or stored, which is why the tool works with the network disconnected.

G

Prefer AllUtil on Google

One click adds AllUtil to your Google preferences. You'll see our tools highlighted with a Preferred badge in Search and AI answers.

2× more likely to clickWorks in AI Overviews

Reviewed by Unreviewed

Written by Hamza AK. We research, build and test every tool before it is published.

Editorial policy

Last updated

Rechecked against the sources on this date, not stamped.

Methodology

Token counts are exact for o200k_base — this is OpenAI's published tokenizer, not an approximation. However, OpenAI may change tokenizers in future model releases without notice. Pricing was read from developers.openai.com/api/docs/pricing on 18 August 2026; vendors change prices without notice. The date this table was verified is shown on the page.