Runs locally
Your text is processed on your device. Nothing is uploaded to Tokens Calculator.
Count tokens and estimate API cost for GPT, Claude, and Gemini — locally in your browser.
Local token pieces update 0.5 seconds after you stop typing.
Paste text above to see how the selected local encoder splits it into tokens.
Local calculation. Your text stays in this browser. Nothing is uploaded or stored by Tokens Calculator.
Compare the same text using the available local encodings and current list-price estimates.
| Model | Tokens | Input / 1M | Input cost |
|---|---|---|---|
| GPT-4oOpenAI | 0 | $2.50 | $0.000000 |
| GPT-4OpenAI | 0 | $30.00 | $0.000000 |
| Claude 3.5 SonnetAnthropic | 0 | $3.00 | $0.000000 |
| Claude Sonnet 4.6Anthropic | 0 | $3.00 | $0.000000 |
| Gemini 2.5 FlashGoogle | 0 | $0.30 | $0.000000 |
| Gemini 2.5 ProGoogle | 0 | $1.25 | $0.000000 |
Claude and Gemini counts are useful approximations using cl100k_base; provider tokenizers can differ by model version and text.
Your text is processed on your device. Nothing is uploaded to Tokens Calculator.
See the same text through GPT-4o, GPT-4, Claude, and Gemini-compatible encodings.
Apply published per-million-token list prices to either input or output token usage.
Paste or type the text you want to measure into the calculator.
Choose a GPT, Claude, or Gemini model to apply its compatible local encoding and published price.
Read the token, character, word, and estimated API cost values. Switch between input and output pricing when needed.
No. Token counting and price estimation run in your browser. Tokens Calculator does not upload, store, or inspect the text you paste.
Models use different tokenizers. This tool uses o200k_base for GPT-4o and cl100k_base for GPT-4 plus useful Claude and Gemini approximations, so results can vary by model family.
Choose Input or Output in the calculator. The estimate applies the selected model's published list rate to the token count in your text; it does not combine both directions into one invented request total.
Prices are stored in a small configuration file and checked against provider documentation. Providers can change pricing, so follow the provider-pricing link before making a production budget decision.
Every tool runs token counting in your browser. Keep your text local while you move between calculators and guides.
Not affiliated with Anthropic, OpenAI or Google.