LLM token counter and cost calculator

Paste text to see how a model splits it into tokens, how many tokens it is, and what that costs as input at each model’s list price. Counts for the OpenAI tokenizers o200k_base and cl100k_base are exact; counts for other model families use the closest available tokenizer and are labelled as estimates.

  • Free
  • Runs in your browser
  • No account
  • Nothing is uploaded

How it works

The page loads the same byte-pair-encoding tables OpenAI publishes (o200k_base and cl100k_base) and runs the tokenizer in your browser, so the count is the count the API would bill for those encodings.

Each token is drawn as its own piece, so you can see where words split, how spaces and line breaks are counted, and how scripts such as Tamil or Japanese spread one character over several tokens.

The cost panel multiplies the token count by each model’s input price from the PromptFlowEngine model catalog. Output tokens are your own estimate, because the real number depends on the answer.

The structured-data panel converts a JSON payload to TOON and shows the token count of each form, so you can see what a format change saves before you change any code.

Worked example

These counts were produced by the tokenizer when this page was built.

TextCharacterso200k_base tokenscl100k_base tokens
Summarize the attached incident report in five bullet points for an on-call engineer.851717

Limits

Questions

Is the token count exact?

For the OpenAI tokenizers o200k_base and cl100k_base, yes: the real tokenizer runs in your browser. For other model families the count is an estimate made with the closest available tokenizer, and the page labels it as an estimate.

Is my text sent anywhere?

No. Tokenizing and cost arithmetic run in your browser. The text you paste is not uploaded.

Why do two models count the same text differently?

Each model family uses its own tokenizer with its own vocabulary, so the same text splits into a different number of pieces. That is why a prompt can cost more on one model than another even at the same price per token.

How many tokens is a word?

It depends on the word and the tokenizer. Common English words are often one token, longer or rarer words split into several, and text in other scripts usually takes more tokens per character. Paste your own text to see the real split.

Privacy

This tool runs in your browser. The text, files and numbers you enter are not uploaded, logged or stored on a server, and no account is needed. The site counts that a tool was used, never what was entered. Privacy and security lists everything the site stores and sends.

Use it where you write prompts

The same engine runs in your editor and your browser, so you do not have to come back to this page.

Keep going