Skip to content
Utility

Token Counter & Cost Estimator

Estimate tokens and API cost for your text across popular models.

Token Counter & Cost Estimator — Estimate tokens and API cost for your text across popular models.
Token Counter & Cost Estimator
Estimate tokens and API cost for your text across popular models.

Runs entirely in your browser. Your text is never uploaded.

Tokens are how AI models measure text, and they are what you pay for when using an API. This tool estimates the token count of any text and shows the approximate cost across popular models, so you can size prompts and budget with confidence.

Type or paste your text and set the expected output length. For exact counts, providers offer their own tokenizers, such as the OpenAI tokenizer. Learn how tokens affect prompting in our fundamentals guide.

How to estimate tokens and cost

1

Paste your text

Add the prompt or content you want to measure.

2

Set expected output

Enter roughly how many tokens you expect the answer to use.

3

Read the estimate

See the token count and a cost breakdown per model, updated as you type.

What a token actually is

A token is a chunk of text the model treats as one unit. It is not a letter and not quite a word. In English the working average is about four characters, or roughly three quarters of a word, so 1,000 tokens is somewhere near 750 words of ordinary prose.

The splitting rules are less tidy than that average suggests:

  • Common words are usually a single token. "The", "water", "because" cost one each.
  • Longer or rarer words break apart. Something like "unbelievable" may land as three pieces.
  • The space in front of a word normally travels with it, so " cat" and "cat" are different tokens.
  • Numbers often split digit by digit, which is why order IDs, hashes and timestamps are expensive for how short they look.

Other languages do not get the same deal. Tokenizers are trained mostly on English text, so Spanish, French and German typically run 1.5 to 2 times heavier for the same meaning. Japanese, Chinese, Korean, Arabic and Cyrillic scripts can be worse again, with a single character sometimes costing two or three tokens.

Code behaves differently too. Indentation, brackets, quotes and camelCase identifiers all fragment. Minified JavaScript or a base64 blob can be several times denser than prose of the same character length — worth knowing before you paste an entire file into a chat window.

Why limits and pricing both run on tokens

Two separate things are measured in the same unit, which is where most of the confusion starts.

The first is the context window: the total text a model can hold in mind for one request. Everything counts — your instructions, the conversation so far, any attached file, and the space reserved for the answer. Overflow it and the oldest messages get dropped or the request fails. Dropped context is invisible, which is why a long chat sometimes starts contradicting things you agreed twenty messages ago.

The second is billing. Providers charge per million tokens, split into input and output. If you are working out whether an automation is viable at scale, that split is the number that matters, and the fundamentals of prompt engineering are worth reading alongside it — a tighter prompt is usually a cheaper one.

Input, output, and the quiet cost of history

Output tokens almost always cost more than input tokens — commonly around five times more. There is a mechanical reason. Input is processed in one parallel pass, while output is generated one token at a time, each one requiring a full trip through the model. You pay for the sequential work.

The practical consequence surprises people: a 3,000-word prompt is often cheaper than a request that produces a 3,000-word answer. If your bill is climbing, look at what the model is writing before you look at what you are sending. Capping length in the prompt is the fastest lever you have:

Summarise the report below in under 150 words. Bullets only. No introduction, no closing remarks.

Then there is conversation history. Chat is stateless underneath: every turn resends the entire thread. At turn ten you pay to reprocess turns one through nine again. Twenty turns of 500 tokens is not 10,000 tokens of input, it is nearer 100,000 once you count the resending. Long threads get expensive quietly, without any single message looking large. Break the cycle by carrying the thread forward yourself:

Summarise everything we have decided in this conversation in under 200 words: decisions made, constraints agreed, open questions. I will paste this into a new chat.

Cutting tokens without losing quality

Most prompts have slack that costs money and adds nothing:

  • Delete the politeness padding. "I was wondering if you could possibly help me with" is a dozen tokens of nothing.
  • Trim pasted material to the relevant part. Two paragraphs of the contract, not the whole contract, when your question is about one clause.
  • Start a fresh chat when the topic changes. You stop paying for history that no longer helps.
  • Move stable instructions into a system prompt instead of repeating them every turn.
  • Ask for structure. A JSON output or a plain table is usually shorter than the same information in prose, and easier to use afterwards.
Tip: Cut output before you cut context. Removing background detail makes answers worse; removing preamble, hedging and repetition from the response makes them better *and* cheaper.

What not to cut: the context the model cannot infer — your audience, your constraints, what you already tried. That is the part doing the work. Vagueness is one of the most common prompting mistakes, and it costs you a second attempt, which costs more than the words you saved. Run a bloated draft through the prompt optimizer to shorten it, or start lean with the ChatGPT prompt generator.

Why this is an estimate

Every model family uses its own tokenizer, and providers update them between versions. Two models can read the same paragraph and count differently. A counter that runs entirely in your browser applies a well-calibrated approximation rather than shipping a dozen vocabulary files — and rather than sending your text anywhere.

For everyday planning — will this fit, roughly what will it cost, is this prompt twice as long as it needs to be — the estimate is close enough to act on. Treat it as accurate within a few percent for English prose, looser for code and non-Latin scripts. When you need an exact figure for billing, check the OpenAI tokenizer or the token count returned in the API response itself.

FAQ

Frequently asked questions

It is a close approximation based on character and word counts. Exact tokenization varies by model, so use the providers' official tokenizers when precision matters.
Models have context limits measured in tokens, and API pricing is per token. Knowing your token count helps you avoid truncation and control cost.
The tool uses representative public prices for common models. Always check the provider's pricing page for the exact, current figures before relying on them.

Write your next prompt in seconds

Turn a rough idea into a clear, structured prompt any AI can follow. Free, private, and no account needed.

Open the Prompt OptimizerSee all tools