Useful Hacks

Token Counter

Exact token counts for OpenAI models, plus calibrated per-model estimates for Claude, Llama, Gemini and Mistral.

Processed locally in your browser. Nothing you paste is sent anywhere.
  • Uses the actual tokenizer for OpenAI models, so the count matches what the API will bill and budget.
  • For Claude, Llama, Gemini and Mistral, uses a characters-per-token ratio calibrated per family — not one generic ±10–20% guess applied to every non-OpenAI model.
  • Token, word and character counts side by side, updating as you type.
  • Runs in your browser — prompts and documents aren't uploaded.

Why this is private

  • Processed locally in your browser. Nothing you paste is sent anywhere.
  • Open your browser's DevTools → Network tab while using this tool — you won't see a request carrying your input, because it never leaves your device.
  • Nothing you enter is uploaded to a server or shared with us — the processing happens entirely on your device.

Overview

Counts tokens for a piece of text — an exact count using OpenAI's real tokenizer for GPT models, or a calibrated per-model-family estimate for Claude, Llama, Gemini and Mistral, none of which publish a fully open tokenizer.

How to use it

  1. 1Paste your text.
  2. 2Choose the tokenizer matching your target model — the dropdown groups exact tokenizers separately from approximate ones.
  3. 3The token, word and character counts update live.

Tips

  • Approximate tokenizers are most accurate for plain English prose — expect more drift for code, non-English text, or heavy punctuation/whitespace, where character-based estimates diverge more from any real BPE tokenizer.

Frequently asked questions

What people use it for

Check a prompt fits the context windowConfirm a system prompt plus context is well under the model's limit before sending.
Estimate the cost of a requestTake the token count to the AI API Cost Calculator for a full monthly cost estimate, instead of multiplying by hand.
Trim a prompt to a budgetEdit and watch the count until it's under a target.
Size chunks for embeddingsMake sure each chunk stays under the embedding model's input limit.
Compare a prompt's rough length across model familiesSwitch the tokenizer to see how the same text is estimated for Claude vs. GPT vs. Gemini.

Related tools

All ai & llm tools

Ready to use Token Counter?

Token Counter

Search tools

Search for any tool by name, category or keyword