DevToolBox

LLM Token Counter

Count tokens, estimate API cost and check context usage.

Runs locally — nothing is uploaded

Loading…

How to Use

What is LLM Token Counter? LLM Token Counter is a free browser-based tool for counting tokens in LLM prompts, estimating API costs and checking context window usage. All computation happens locally in your browser — your text never leaves your device.

How to use it 1. Pick a model (GPT-4o, GPT-5, Claude, DeepSeek, Gemini, Llama and more). 2. Paste text or load a file in the Token Count tab to see token, character, word and line counts. 3. Open the Cost tab to estimate input and output costs in USD and CNY. 4. Open the Context tab to see how much of the model's context window your text uses, and how many copies fit.

A note on accuracy OpenAI models are counted with the exact tokenizer. Claude, DeepSeek, Gemini and Llama have no official JavaScript tokenizer, so their counts are marked as estimates.

LLM Token Counter — Count Tokens & Estimate API Cost