Free developer tool

Token Counter — Estimate LLM Token Counts & API Costs

Estimate the number of tokens in your prompt, code snippet, or document — plus the approximate API cost across Claude, GPT, Gemini, and other models. No account or upload required.

Free to useNo account, no signup, no credit card.
Private by designRuns entirely in your browser. Nothing is uploaded.
Quick estimatesPaste text, see tokens and costs instantly.

Paste your text to count tokens

Enter a prompt, code snippet, or document. Token counts are estimates — actual counts depend on the model's tokenizer.

0
Characters
0
Words
0
Lines
0
Est. Tokens

Private by design

This tool runs entirely in your browser. No text is uploaded, stored, or transmitted. Use it for any prompt, code snippet, or document without worrying about data exposure.

How to use this tool

  1. Paste your prompt, code, or document into the text area.
  2. See the estimated token count, characters, words, and lines instantly.
  3. Select a model to see the estimated API cost for input and output tokens.
  4. Use the estimate to budget your AI API usage or compare model costs.

When to use the official tokenizer

This tool uses a heuristic approximation. For exact token counts — especially before making cost commitments or debugging prompt limits — use the provider's official tool:

Related tools

Affiliate disclosure: Some links on this website may be affiliate links. If you click and purchase, we may earn a commission at no additional cost to you. Our recommendations are based on research, usability, pricing, and user needs.

FAQ

Is this token counter accurate?

Token counts are estimates based on heuristics. Each LLM provider uses a different tokenizer. Always use the official tool (e.g. Anthropic's token counting endpoint, OpenAI's tiktoken, or Google's tokenizer) for exact counts before making cost commitments.

Does this tool send my text to a server?

No. This tool runs entirely in your browser. Nothing is uploaded or stored on any server.

How do you estimate tokens?

We use a rough heuristic: approximately 4 characters per token for English text and 1.5 characters per CJK character. This is an approximation — actual tokenization depends on the specific model.

Which models are included in the cost estimate?

Claude Sonnet 4.6, Claude Opus 4.7, Claude Haiku 4.5, GPT-4o, Gemini 2.5 Flash, DeepSeek V3, and Kimi K3. Prices are as of July 2026 and may change.