Count tokens in your text
Count tokens in pasted text and estimate the input cost for a selected model.
Your text
Paste a prompt, draft, or document excerpt. Counting happens in your browser.
Your text stays on this device. The tokenizer files load from this site when needed.
119
20
Token counts
OpenAI counts use the named encoding. Other models use an estimate.
- o200k_base OpenAI encoding · exact plain text
- 23
- cl100k_base OpenAI encoding · exact plain text
- 23
- Claude, Gemini, Llama, others Estimate · one token per four characters
- 30
Example counts shown.
Estimated input cost
Pick an API model. This applies its published input rate to the count above and excludes output tokens.
$0.000002
23 o200k_base tokens × $0.1 per million input tokens. Check the model's tokenizer if it uses another encoding.
Model source: OpenAI model rates. Checked September 28, 2026.
Model data from models.dev (MIT).
A token count helps size a draft. Your operator can choose a model for each task and keep the work moving across providers.
Embed this tool
Copy this snippet to show the tool on your site.
How it works
Characters count Unicode code points; words are groups of letters or numbers. OpenAI plain-text counts use the o200k_base and cl100k_base byte-pair encodings with local rank tables.
Other model counts are estimates: Unicode character count divided by four, rounded up. That rule is only a planning shortcut, especially weak for code and text outside English.
Estimated input cost equals displayed tokens multiplied by the selected model input rate per million, divided by one million. Price sources and checked dates appear with each model.
Sources and checked dates
Limits
- OpenAI counts cover pasted plain text under the named encodings. They exclude chat wrappers, tool calls, images, audio, and provider billing adjustments.
- Claude, Gemini, Llama, and other model counts use a rough character rule. Their actual tokenizers and billed usage can differ substantially.
- Input cost uses the selected model's published US dollar rate and excludes output, cached input, batch discounts, and taxes.
Common questions
- Are OpenAI counts exact?
- The o200k_base and cl100k_base counts use their encoding rules for the pasted plain text. A full API request can add role, tool, image, or other tokens.
- Why are Claude and Gemini labeled estimates?
- This page does not run those providers' tokenizers. It divides character count by four, so language, code, and formatting can change the actual count.
- What does the cost include?
- It multiplies the displayed token count by the selected model's input price per million tokens. Output tokens and any provider-specific discounts or minimums are excluded.
Related tools
- AI model picker
Choose a model class for a task, then verify current provider facts.
- AI subscription cost calculator
Compare the cost and listed capabilities of AI subscriptions.
OperatorNest can take on repeat work, check with you before consequential steps, and leave a receipt for the result. See how an always-on operator works.
Hand off your first task tonight.
Tell us your email and what you'd hand off first. We'll send your access details and help you set up your operator.