Toolman

AI Token Counter

Paste a prompt to estimate its token count across popular large language models, and see roughly what it will cost per API call. Nothing is sent anywhere — the estimate is computed in your browser.

Characters
0
Words
0

Estimated tokens by model

ModelTokensChars / tokenEst. cost

Estimates use per-family heuristics calibrated on English, code and CJK text. Real counts from the provider tokenizer are typically within a few percent.

What is a token?

Large language models do not read characters or words — they read tokens, the units produced by a byte-pair-encoding tokenizer. A token is usually a common word, a word fragment, a punctuation mark or a piece of whitespace. Both the input you send and the output the model generates are billed per token, and every model has a maximum context window measured in tokens.

Rules of thumb

ContentApproximate ratio
English prose~4 characters per token, ~0.75 tokens per word
Source code~3–3.5 characters per token (indentation and symbols cost more)
Chinese, Japanese, Korean~1–1.5 characters per token
Numbers and IDsOften 1 token per 1–3 digits
Base64 or random stringsVery expensive — close to 1 token per 2 characters

Why token count matters

How to reduce token usage

  1. Cut redundant instructions and repeated examples from system prompts.
  2. Send data as compact JSON or CSV instead of verbose prose or pretty-printed JSON.
  3. Summarise long conversation history rather than resending it verbatim.
  4. Use prompt caching where the provider supports it, so a stable prefix is billed at a lower rate.
  5. Ask for structured, bounded output instead of free-form explanations you will discard.

Frequently asked questions

How accurate is this token counter?

It is an estimate. Rather than a flat "characters ÷ 4" rule, it classifies the text into words, numbers, punctuation, whitespace and CJK segments and applies per-family weights, which tracks real tokenizers closely for ordinary prose and code. For billing-critical decisions, confirm with the provider’s official tokenizer.

Why do different models report different counts?

Each model family uses its own tokenizer and vocabulary. OpenAI’s o200k encoding, Anthropic’s tokenizer, Google’s SentencePiece variant and Llama’s tokenizer all split the same sentence slightly differently, especially for non-English text, code and emoji.

Does the counter send my prompt anywhere?

No. The whole calculation is a few hundred lines of JavaScript running in your browser, so it works offline and is safe for confidential prompts.

How many tokens is one page of text?

A page of single-spaced English is roughly 500 words, which is about 650–700 tokens. A 300-page book lands near 130,000 tokens.

Are input and output tokens priced the same?

No. Output tokens usually cost several times more than input tokens, which is why capping response length is often the fastest way to cut a bill.

Do images and files count as tokens?

Yes. Vision models convert an image into a block of tokens based on its resolution, and audio or PDF inputs are similarly converted. This tool measures text only.

Related tools