Free browser token calculator

Token Calculator for LLMs

Count tokens locally for prompts, documents, code, JSON, and chat messages, then estimate LLM API cost across major providers.

Paste text to count tokens

Your text stays in this browser.0 total characters

Token visualization

Pieces appear as the local tokenizer reads your text.

0 tokens
Paste text and the token visualization appears here.

Token summary

Tokens
0
Words
0
No-space chars
0
All chars
0

Cost snapshot

Lowest input rate
Gemini 2.5 Flash-Lite$0.1/1M
Providers covered
Major LLM APIs3 providers

Paste text to turn the pricing table into exact estimated costs for your prompt.

What is a token calculator?

A token calculator estimates how much text an LLM will process before you send a request. Tokens are the units used for context limits and API billing, so the count matters for prompts, documents, code, JSON, and chat transcripts. Token-Calculator.net runs the browser calculator locally, shows word and character counts alongside tokens, and turns the same count into estimated input, cached-input, and output costs for major model providers.

Use it when you need to check whether a prompt fits a context window, compare model cost before an API call, trim repeated instructions, or explain usage to a product or finance team.

Prompt planning

Estimate token count before a user prompt, system prompt, or multi-turn chat goes to an LLM.

Document checks

Paste policy text, research notes, transcripts, or long-form content to judge request size.

Code and JSON

Measure structured data, code snippets, logs, and payloads that often use tokens differently from prose.

Cost comparison

Use one token count to compare OpenAI, Claude, and Gemini pricing before choosing a model.

How to use the token calculator

  1. 1Paste the text you want to measureUse a prompt, document excerpt, code snippet, JSON payload, or chat message.
  2. 2Read the token, word, and character countThe calculator updates locally in the browser and keeps the text on your device.
  3. 3Compare estimated LLM costUse the token count with OpenAI, Claude, and Gemini pricing rows to estimate input, cached-input, and output cost.
  4. 4Adjust the prompt before using an APIShorten repeated instructions, split long context, or choose a lower-cost model when the estimate is too high.

Token calculator by use case

The main calculator works for general LLM planning. These focused guides explain provider and conversion-specific cases without changing how the browser calculator works.

Compare Token Costs

Compare input, cached-input, and output pricing across major LLM providers. Long-context tiers are applied automatically when your token count crosses a provider threshold.

Full model pricing table

Rates update the estimates above as soon as you paste text.

Token Calculator FAQ

Quick answers for token counts, local browser processing, model price comparisons, and prompt planning.

Learn how token counts affect cost

These guides explain AI tokens, tokenization, word-to-token ratios, cached input pricing, context windows, and prompt optimization without crowding the calculator page.

Need token counts in your app?

Use the paid Token-Calculator.net API for metered token, character, and word counts with key-based access. The browser calculator remains free; API access requires an active subscription.

POST /api/v1/tokenizeView API pricing