Skip to content
FreeAIDevTools

OpenAI Token Counter

Exact counts for GPT models, run in your browser with OpenAI's own tokenizer.

How do you count OpenAI tokens? Paste your text into the counter. It runs OpenAI's o200k_base tokenizer in your browser, the encoding GPT-5, GPT-4.1, GPT-4o and o3 bill with, so the number matches the API. OpenAI's rule of thumb is about 4 characters or 0.75 words per token in English. GPT-6 has no published tokenizer, so its counts assume o200k_base.

0 characters0 words~0 tokens
Compare models:

$2 input · $10 output per 1M tokens

Input tokens (est.)
0 · $0.00000
Output cost
$0.0050
Cost per call
$0.0050
Per day$5.00
Per month (30 days)$150.00

Same text on other models

Runs in your browser. OpenAI models show exact counts from the official tiktoken tokenizer (o200k_base). Other providers are estimates from characters-per-token ratios, so treat them as a guide; for exact counts use Anthropic's count_tokens endpoint or Gemini's countTokens method. Prices shown are standard rates; some models charge more for very long prompts (for example OpenAI GPT-5.5 and later above 272K input tokens, xAI above 200K, Claude Haiku 5.5 above 100K).

Open the full Token Counter →

The Inference Report · Every Tuesday

Know when AI prices change.

One short email every Tuesday: new models, price moves and free tiers that were cut or added. Five minutes, no fluff.

No spam. Unsubscribe anytime.

Why are OpenAI counts exact here?

OpenAI publishes its tokenizer as the open source tiktoken library, and a JavaScript port of it runs on this page. Your text is split into tokens on your own machine, with nothing uploaded, which is the same split OpenAI's servers make when they bill you. That is the difference from the estimates on the Claude token counter and the Gemini token counter: those providers do not ship a tokenizer you can run locally.

The one gap is GPT-6. OpenAI has not published which encoding the GPT-6 models use, and the tiktoken library has no GPT-6 entry yet. We assume o200k_base, as for GPT-5. If you need certainty for a GPT-6 bill, compare our count with the usage field in one real API response.

What does a token count leave out?

The counter measures the text you paste. A real request bills more input than that: the system prompt, every earlier turn of the conversation you resend, and any tool definitions all count as input tokens. Paste the whole request body, not only the user message, when you are sizing a production call.

Output is billed separately and costs more. GPT-6.1 Sol charges $2 per 1M input tokens and $10 per 1M output tokens, so set the expected reply length in the counter as well. On reasoning models, the hidden reasoning tokens are billed as output too.

What does a 2,000-word document cost on OpenAI?

At OpenAI's 0.75 words per token, 2,000 words of English is about 2,667 tokens. As input, that costs $0.00533 on GPT-6.1 Sol and $0.00027 on GPT-6 Luna. Small numbers per call, but a pipeline that sends the same document 10,000 times a day turns them into a real line item. Every current model's rate is in our OpenAI API prices table, and the LLM cost calculator projects a monthly bill. Batch, cache-write and long-prompt rules are on the OpenAI API pricing page.

Frequently asked

Does OpenAI use the same tokenizer for GPT-6?

OpenAI has not said. The tiktoken library maps GPT-5 models to o200k_base and has no GPT-6 entry yet, so this counter assumes o200k_base for GPT-6 as well. The usage field in an API response gives the billed number if you need to confirm it.

How many tokens is 1,000 words for OpenAI models?

About 1,333, using OpenAI's rule of thumb of 0.75 words per token for English text. When we measured how many tokens a word is on o200k_base, English prose came to 1,318 to 1,390 tokens per 1,000 words. Code, numbers, URLs and most other languages produce more tokens per word, so paste a real sample for the exact figure.

Is the OpenAI API free to use for counting tokens?

You do not need the API at all to count tokens: the tokenizer here runs offline in your browser and costs nothing. To call GPT models you need prepaid credit; see is the OpenAI API free for what new accounts get.

More in this series