DevCostLab

Free developer calculator

Token Calculator for LLM Prompts

Estimate tokens, characters, words, context usage, and input cost before sending text to an LLM.

Your text is processed locally in your browser and is not stored.

Local estimate

Estimated tokens

12

Estimated input cost

$0.000048

Characters

46

Words

8

Estimated, not an exact provider tokenizer. The V1 heuristic uses roughly four characters per token and may vary for code, symbols, and non-English text.

Pricing last verified: Sep 3, 2026Official source

How this token estimate works

Tokens are the text units processed and billed by language models. A token can be part of a word, a whole short word, punctuation, or a code symbol. This calculator uses a transparent planning heuristic of approximately four characters per token.

Actual counts vary by provider tokenizer, language, punctuation, formatting, and code density. Treat the result as a rough estimate; the provider's tokenizer or API usage record is the billing authority.

Example token counts

These static examples use the same local estimator. Context usage is measured against Claude Sonnet 5's 1,000,000-token window.

Short prompt

Summarize this meeting in five bullets.

Characters
39
Estimated tokens
10
Context used
0.0010%

Longer system prompt

You are a careful technical editor. Preserve facts, flag uncertainty, use concise headings, and return a short action list after the summary.

Characters
141
Estimated tokens
36
Context used
0.0036%

Code snippet

function total(values: number[]) { return values.reduce((sum, value) => sum + value, 0); }

Characters
90
Estimated tokens
23
Context used
0.0023%

Turn the estimate into API cost

Copy the estimated input tokens into the LLM Cost Calculator, then add expected cached input, output tokens, and request volume for a monthly workload estimate.

Your pasted text stays local

Text remains in browser memory while you use the calculator. It is not stored, added to URLs, sent over the network, or included in analytics payloads; analytics receives only a coarse token-result range.

For capacity planning, also check the Context Window Calculator or compare available models on the model pricing page.