01What is Token Counter?
Before you send a long prompt to an LLM API, it helps to know roughly how big it is and what it will cost. Paste your text here and you get a token estimate plus a price on current Claude, GPT and Gemini models. Let's be upfront about one thing. This tool does not run a real tokenizer. Each model family splits text with its own tokenizer, so no single number can be exact for all of them. Instead we apply the two rules of thumb that providers quote for English prose. One says a token is about four characters. The other says a token is about three quarters of a word. The tool shows both figures, labelled "Characters ÷ 4" and "Words ÷ 0.75", and rounds each one up. The headline estimate is the higher of the two. That leans you toward over-budgeting, which is the safer mistake. Characters are counted as Unicode code points, so an accented letter counts once. Words are runs of text split on whitespace. Here is a quick worked example. "Hello, world!" is 13 characters and 2 words. Thirteen divided by four rounds up to 4, and two divided by 0.75 rounds up to 3. So the estimate is 4 tokens. A line of code like "const x = arr.map((v) => v * 2);" goes the other way. The word rule gives 11 and beats the character rule's 8. The Cost Estimator prices the estimate twice: once as input, and once as if the same text were generated as output. List prices come from each vendor's pricing page and are labelled in the tool with the date they were checked, 21 November 2026. You can type your own input and output price per million tokens to override them, for a negotiated rate or a batch discount. Long-context tiers kick in on their own. For example, Claude Haiku 5.5 moves from $0.10 to $0.50 per million input tokens above 100,000 input tokens. A table below lists the input cost of your text on every model. The limits are real. Code, JSON, URLs, emoji and non-Latin scripts usually take more tokens than these rules suggest. Use the numbers for rough planning, then check the usage figures your API returns. Everything runs in your browser, and your text is not sent anywhere.
Developers and AI engineers who want a quick size and cost check on a prompt before they measure real token usage from the API. The tool runs entirely in your browser, so your data never leaves your device.
02How to use Token Counter
- Paste or type your text into the input box, or load one of the examples (Short prompt, System prompt or Code snippet)
- Read the Estimated Token Count, along with the Characters ÷ 4 and Words ÷ 0.75 figures it is based on
- Pick a model in the Cost Estimator to see the cost under Sent as input and If generated as output
- Optionally type your own Input price / 1M tokens and Output price / 1M tokens to override the list prices
- Scan the table titled Input cost of this text on each model to compare every listed model at once
03Worked examples
- Input:
Hello, world! - Result:
13 characters, 2 words. Characters ÷ 4 = 4, Words ÷ 0.75 = 3. Estimate: 4 tokens - The estimate is the higher of the two rules, each rounded up.
- Input:
The quick brown fox jumps over the lazy dog. - Result:
44 characters, 9 words. Characters ÷ 4 = 11, Words ÷ 0.75 = 12. Estimate: 12 tokens - Input:
const x = arr.map((v) => v * 2); - Result:
32 characters, 8 words. Characters ÷ 4 = 8, Words ÷ 0.75 = 11. Estimate: 11 tokens - Code splits into many short pieces, so the word rule wins here.
- Input:
👋🏽 café - Result:
7 characters, 2 words. Characters ÷ 4 = 2, Words ÷ 0.75 = 3. Estimate: 3 tokens - The waving hand plus its skin-tone modifier counts as 2 code points. Real tokenizers often spend more on emoji.
- Input:
Explain the concept of recursion in programming with a simple example in Python. (Short prompt example, model Claude Sonnet 5.5) - Result:
80 characters, 13 words. Estimate: 20 tokens. At $2 input and $10 output per 1M tokens, 1,000 tokens would cost $0.0020 as input or $0.010 as output - Cost line shows the per-1,000-token figures from the tool's price logic, to keep the numbers readable.
- Input:
150,000 estimated tokens on Claude Haiku 5.5 - Result:
Long-context rate applied: $0.50 input, $2.50 output per 1M tokens. Input cost $0.075 - Above 100,000 input tokens the tool switches to Haiku 5.5's long-context tier automatically.
04Common use cases
- Getting a ballpark token count for a system prompt before deciding whether to trim it
- Rough-costing a long document you plan to send to an LLM for summarization
- Showing a teammate why an output-heavy feature costs more than an input-heavy one, since output rates are higher on every listed model
- Comparing the input cost of one prompt across Claude, GPT and Gemini models in a single table
- Checking whether a large prompt crosses a long-context price tier, such as the 272,000 input token line on the listed GPT models
- Plugging in a negotiated per-million rate to see what a prompt costs under your own contract
- Sanity-checking a budget spreadsheet before you measure real usage from API responses
05Tips
- Treat the number as an estimate. For exact counts, use your provider's token-counting endpoint or read the usage figures the API returns with each response.
- The system prompt and the full chat history are resent on every request, so a long system prompt costs you on every call, not once.
- Output is priced five times or more above input on every listed model, so capping response length often saves more than trimming the prompt.
- If you type a custom price that is not a valid non-negative number, the tool ignores it and uses the list price.
- Emoji with skin-tone modifiers count as two code points here, and real tokenizers often spend even more on them.
06Related concepts
Tokenization, Context window, Token pricing, Prompt length, LLM API cost.
Frequently Asked Questions
What is Token Counter?
Token Counter is a free, browser-based developer tool on AIDToolStack. Estimate tokens and API cost for a prompt on current Claude, GPT and Gemini models It requires no installation or sign-up and works entirely in your browser.
Is Token Counter free to use?
Yes. No sign-up, no fees and no usage cap.
Does Token Counter store my data?
No. It runs in your browser; nothing is uploaded.
Cheat sheet
- AI Agent Rules Files Cheat Sheet: CLAUDE.md, AGENTS.md, Cursor, Copilot, Gemini and More
- Cline Cheat Sheet: Plan and Act, Rules, MCP, Checkpoints and CLI
- Codex CLI Cheat Sheet: Commands, Sandbox Modes, config.toml and MCP
- Gemini CLI Cheat Sheet: Flags, Slash Commands, settings.json and MCP
- GitHub Copilot Cheat Sheet: CLI Commands, Flags and Chat
- LLM API Parameters Cheat Sheet: Claude Messages API vs OpenAI Responses API
- LLM Context Window and Pricing Cheat Sheet: Claude, GPT and Gemini Limits (November 2026)