Local-only · nothing leaves your browser

How do I count tokens for an LLM?

Paste any text to estimate token count for GPT-4, Claude, Gemini, and Llama models. Uses the BPE approximation (~4 chars per token for English). Great for prompt engineering and context window management.

Paste text to see costs...

⚠ JavaScript is required for this tool — the page content above works without it.

F.A.Q. — Questions, answered

  • What is LLM Token Counter?Paste any text to estimate token count for GPT-4, Claude, Gemini, and Llama models. Uses the BPE approximation (~4 chars per token for English). Great for prompt engineering and context window management.
  • Is LLM Token Counter free?Yes. LLM Token Counter runs entirely in your browser. No data is uploaded or stored.
  • Does LLM Token Counter work offline?Yes. Once loaded, LLM Token Counter works fully offline except for the QR code generator which uses a pinned CDN with SRI.

Keep exploring

Top Hugging Face Models →

Live rankings updated daily — the chart behind this tool.