What is this LLM token counter?
Large language models like Claude and GPT bill by the token, not the word. Before you send a long prompt — a system message, a pasted document, a few-shot example set — it helps to know roughly how many tokens it is and what it will cost. This tool estimates the token count of any text and shows the projected cost across the current Claude and GPT models, side by side.
Why use this tool?
Prompt engineers and developers use token counts to stay under context limits, compare model costs, and budget API usage. A 50-page document might be 30,000 tokens — fine for a 1M-context model, impossible for a 200K one. Paste it here and you'll see immediately. Everything runs in your browser, so even confidential prompts never leave your device.
Token rules of thumb
- 1 token ≈ 4 characters ≈ 0.75 words in English
- 1,000 tokens ≈ 750 words ≈ 1.5 pages of text
- Code, JSON, and non-English text tokenize less efficiently (more tokens per character)
- Both your input and the model's output are billed — factor in the response length
Frequently Asked Questions
Is this exact?
No — it's a fast estimate. Real tokenizers aren't available client-side, so the count is approximate. For exact Claude token counts, call Anthropic's /v1/messages/count_tokens endpoint; for OpenAI models, use the tiktoken library. Note that tiktoken undercounts Claude tokens, so don't use it for Claude.
Are the prices current?
They reflect published rates as of June 2026 and can change — always confirm with the provider's pricing page before relying on a cost figure.
Building with Claude or other agents? See our AI agent rankings, MCP servers directory, and coding agent comparison. Or browse the full tools collection.