webdevpuneet.com
TToken Counter & AI Cost
Estimates in your browser. Nothing is uploaded.
Your text or prompt
327 characters56 words3 linesGPT-style ~75 tokensClaude-style ~84 tokens
SizeA few sentences
Cheapest per call$0.0003Claude Haiku 5.5
1,000 calls, cheapest$0.2584standard price
Cost settings
Token counts here are estimates (usually within about 10 to 15 percent for English). For an exact count, use the provider's own token-count endpoint before you send a big job.
Cost and context window by model
ModelInput tokens$ in / 1M$ out / 1MPer call1,000 callsContext window
Claude Opus 5.5
Claude-style estimate
~84$0.0103$10.34
fits
<0.01% used
Claude Sonnet 5.5
Claude-style estimate
~84$0.0052$5.17
fits
<0.01% used
Claude Haiku 5.5cheapest
Claude-style estimate
~84$0.0003$0.2584
fits
<0.01% used
GPT-5.4
GPT-style estimate
~75$0.0077$7.69
fits
<0.01% used
GPT-5
GPT-style estimate
~75$0.0051$5.09
fits
0.02% used
GPT-style estimate
~75$0.0016$1.58
fits
0.06% used

Prices are US dollars per million tokens and can change, so edit any rate to match the provider's current pricing page. The table uses the standard text rate. Cached input is counted at 10 percent of the input rate and batch jobs at 50 percent, which match the usual discounts, but the extra cost of writing a cache and any long-prompt surcharge (some models charge more above 100,000 or 272,000 tokens) are not included. Images, audio and tool calls are priced differently.

Token Counter and AI Cost Calculator

Updated November 20, 2026

What's included

Features

Token estimate as you type - GPT-style and Claude-style counts side by side
Cost per call and in total - input and output priced separately, for any number of calls
Prompt caching slider - see the saving when the start of your prompt is reused
Batch API switch - halve the price for jobs that can wait
Context window check - see the share of each window used and whether input plus reply fits
Cheapest model marked - spot the lowest-cost listed model for your prompt at a glance
Reply length presets - Short, Paragraph, A page, Long and Code file, or type your own
Editable prices and sizes - type in the current rates from the provider's pricing page
Your own model row - name a model and set its rates and window
Sample texts and file open - a prompt, an article, code or JSON, or load a file up to 4 MB
Copy summary - paste the estimate into a ticket, budget note or chat
Private and remembered - runs in your browser, nothing is uploaded, and your last session is kept on your device

About this tool

Know What a Prompt Will Cost Before You Send It

AI APIs charge by the token, and the context window is counted in tokens too, but a prompt is written in words. That gap is where surprise bills and "input too long" errors come from. This counter turns your text into an estimated token count, then shows what the call would cost on Claude, GPT and a model of your own, and how much of each context window it fills.

Paste a system prompt, a document or a chunk of code, set the reply length you expect and the number of times you will run it, and the table does the arithmetic: cost per call, total cost, the cheapest listed model, and whether input plus reply fits. Two sliders cover the things that change a real bill most: how much of the prompt is read from the cache, and whether the job can run as a cheaper batch. It is useful for budgeting an app that calls a model thousands of times, for deciding whether a long document needs to be split, and for comparing a small model against a large one before you commit.

The counts are estimates. The tool splits your text the way a byte-pair tokenizer tends to, with short words as one token, longer words split into pieces, digits grouped in threes, one token per punctuation mark, and heavier counts for code-like symbols, emoji and non-Latin scripts. It lands within roughly 10 to 15 percent for ordinary English, which is close enough to plan with. Use the provider's own token-count endpoint when you need the exact number.

Prices move quickly, so every rate and context size is a field you can edit, and the defaults were reviewed on 2026-11-20. Everything runs in your browser, your text is never uploaded, and your last session is remembered on your device only. If you are writing the prompt itself, AI Prompt Studio helps you structure it, and Word Counter, Markdown Editor and Diff Checker are handy for tidying and comparing the text first.

Step by step

How to Use

  1. 1
    Paste your prompt or textPaste the system prompt, the question and any documents or code you plan to send, or use Open file to load a text, Markdown, JSON or code file. The Sample menu loads a support prompt, a long article, a code file or JSON if you just want to see how it works. The counter updates as you type and nothing leaves your browser.
  2. 2
    Read the token estimateThe pills under the box show characters, words, lines and an estimated token count in two styles: GPT-style and Claude-style. Claude-style runs a little higher for the same English text. Three cards underneath show the size in pages, the cheapest cost per call and the cheapest total.
  3. 3
    Set the reply lengthOutput tokens cost several times more than input tokens, so say how long the answer will be. Tap Short, Paragraph, A page, Long or Code file, or type your own number. A short answer is around 200 tokens, a page of writing around 800, and a long code file can pass 4,000.
  4. 4
    Choose how many callsSet how many times the same prompt will run, or tap 1, 100, 1k, 10k or 100k calls. The table shows the cost of one call and the total for all of them, with the cheapest listed model marked.
  5. 5
    Add prompt caching and batch pricingIf the start of your prompt is the same on every call, drag the cache slider to the share of input that will be read from the cache, which is billed at about a tenth of the normal input rate. Tick Batch API if the job can wait, which is usually about half price.
  6. 6
    Check the context windowEach row shows how much of that model's context window the input uses and whether input plus reply fits. If a row says too long, trim the text or pick a model with a larger window.
  7. 7
    Edit the prices if they have changedEvery rate and context size in the table is an editable field, and the last row is a model you can name yourself. Prices change often, so check the provider's pricing page and type in the current numbers. Your text and settings are remembered in this browser for next time.
  8. 8
    Copy the summaryCopy summary puts the estimate and the per-call cost for every model on your clipboard, ready to paste into a ticket, a budget note or a chat with your team.

Real-world uses

Common Use Cases

Budget an app before you build it
Paste a typical request, set the expected reply, and enter a month of traffic as the number of calls. The total shows roughly what the model will cost, and the per-call figure shows how much a longer prompt would add.
Compare a small and a large model
The same prompt can cost ten or twenty times more on a flagship model than on a small one. See both numbers side by side and decide whether the quality gain is worth it for the task.
Check whether a document fits
Paste a contract, transcript or log and see how much of each context window it takes. If it does not fit with room for the reply, you know to split it or summarise it first.
Trim a bloated system prompt
Long instruction blocks are paid for on every call. Edit the prompt in the box and watch the token count and the per-call cost fall as you cut repeated or unnecessary lines, then slide the cache setting to see what reusing the same prefix would save.
Plan a batch job
Summarising 5,000 support tickets or classifying a spreadsheet of products multiplies a small cost by a large number. Enter the call count first and you will not be surprised by the invoice.
Share a cost estimate with your team
Copy summary writes the token estimate and the cost on each model as plain text, so a manager or client can see the numbers without opening the tool.

Got questions?

Frequently Asked Questions

Paste it into the box and the estimate appears straight away. As a rough guide, one token is about four characters or three quarters of a word in English, so 1,000 words is close to 1,300 tokens. Code, numbers and non-English text usually use more tokens per character, which is why pasting the real text beats guessing from the word count.

No, it is an estimate. The counter walks through your text the way a byte-pair tokenizer tends to split it, but it does not download or run the providers' own tokenizers, so expect it to land within roughly 10 to 15 percent for ordinary English. Before a large or expensive job, use the provider's own token-count endpoint to get the exact figure.

Each model family uses its own tokenizer, so the same sentence is cut into different numbers of pieces. The Claude-style estimate here is scaled up a little from the GPT-style one because Claude tokenizers tend to produce somewhat more tokens for the same English text. The gap varies with the content, so treat the difference as a guide, not a rule.

Cost per call is input tokens times the input price plus output tokens times the output price, with both prices given per one million tokens. The total is that figure multiplied by your number of calls. Output tokens are priced higher than input tokens on most models, which is why the reply length setting matters.

The defaults were reviewed on 2026-11-20 against the providers' pricing pages and press coverage, but API prices change often and some models charge more above a long-prompt threshold. Every rate in the table is editable, so check the provider's pricing page and type in the numbers that apply to you. The Reset rates button restores the defaults.

It is the most text a model can take in and answer in a single request, counted in tokens. Your input and the reply have to fit together. The table shows how much of each model's window your input uses and flags rows where input plus the expected reply would not fit.

Prompt caching lets a provider reuse the repeated start of your prompt, such as a long system prompt, and bill that part at a much lower rate. The cache slider assumes cached input costs about 10 percent of the normal input rate. Batch APIs run your requests later and are usually about half price, so ticking Batch API halves the total. The extra cost of writing a cache the first time and any long-prompt surcharge are not included, and images, audio and tool calls are priced differently, so change the rate fields if those apply to you.

No. The counting runs entirely in your browser, and the text is not uploaded or stored. You can paste private prompts or internal documents without them leaving your computer.

Remove repeated instructions, drop boilerplate such as long signatures and legal footers, send only the relevant part of a document, and ask for a shorter reply format such as a list or JSON with fixed fields. Prompt caching helps when the same long prefix is reused, and a smaller model is often enough for simple tasks.

Yes. The last row is your own model: rename it, then set its input price, output price and context window. It uses the GPT-style estimate, which is a reasonable default for most other model families.