ospalabs
Free tool

Token counter and cost check

Paste any prompt, system message or document to see how many tokens it is and what it costs. Counts for OpenAI models use the same tokenizer OpenAI does, so they're exact. The text never leaves your browser.

Counted in your browser. Nothing you paste is sent anywhere.
Tokens
…
Words
33
Characters
194

Exact count with o200k_base, the tokenizer OpenAI uses for gpt-4.1-mini.

As input to gpt-4.1-mini
$0.00
With a 300-token reply
$0.00048
× 1,000 requests
$0.4800
The same request on other models
ModelProviderOne request1,000 requests
gpt-4.1-nanoOpenAI$0.00012$0.1200
gpt-4.1-miniOpenAI$0.00048$0.4800
gemini-3.6-flashGoogle$0.00113$1.13
mistral-medium-latestMistral$0.00225$2.25
claude-haiku-5-5Anthropic$0.00015$0.1500
gpt-4.1OpenAI$0.00240$2.40
gemini-2.5-proGoogle$0.00300$3.00
grok-4.7xAI$0.00180$1.80
gpt-5.6-terraOpenAI$0.00360$3.60
claude-sonnet-5-5Anthropic$0.00300$3.00
claude-opus-5-5Anthropic$0.00600$6.00
gpt-6-astraOpenAI$0.0150$15.00

How it works

What a token is

Models read text in tokens: pieces of words. In English, a token is about four characters or three quarters of a word, but code, numbers and other languages split differently, which is why counting beats guessing.

How the count works

OpenAI models use the o200k_base tokenizer (older GPT-4 and GPT-3.5 models use cl100k_base). This page runs that tokenizer in your browser. For Claude, Gemini, Mistral and Grok it gives a close estimate, because each of those vendors uses its own tokenizer.

How the cost works

Cost = input tokens × the model's input price + output tokens × its output price, using current list prices per million tokens. The reply length is your estimate; set it to what your app usually gets back.

Want these numbers enforced instead of estimated? Put a hard dollar ceiling on your API keys · or see all free tools.

Questions

Is my text sent to a server?
No. The tokenizer is downloaded once and runs in your browser. Nothing you paste is uploaded or stored.
Why doesn't my API bill match the count exactly?
Chat requests add a few tokens per message for roles and formatting, and tools or JSON schemas count too. Your API response's usage field shows the billed number for each call.
How many tokens is 1,000 words?
Roughly 1,300 to 1,400 tokens for plain English with OpenAI's tokenizer. Paste your own text above for the real number.
Are Claude and Gemini token counts exact here?
No, they're estimates made with OpenAI's tokenizer. Each vendor's own tokenizer can come out somewhat higher or lower.