What This Tool Does
This token counter estimates how many tokens a prompt, document, or system message will consume for GPT-4o, GPT-3.5, Claude 3.5, Llama 3.1, or Gemini 1.5, updating live as you type. Alongside the token estimate, it shows how much of that model's context window your text would use, so you can tell at a glance whether a prompt fits before you send it.
How to Count Tokens
Pick a model from the toolbar and paste your text into the panel, the token count, context window bar, and stats all update immediately, no button to press. Switch models at any time to compare how the same text counts differently across GPT-4o, GPT-3.5, Claude, Llama, and Gemini.
Reading the Context Window Bar
The bar fills as your text's token count approaches the selected model's context window limit, turning amber past 80% and red past 95%, with the exact percentage and remaining token count shown alongside it. This makes it easy to catch an oversized prompt before submitting it to an API and hitting a context-length error.
How Token Estimation Works
Token counts are estimated using a roughly 4-characters-per-token heuristic applied per word and punctuation boundary, a close approximation of how BPE tokenizers like tiktoken actually split real English text. Accuracy is typically within about 10 to 15 percent for English prose; code and non-Latin scripts can differ more, since real tokenizers split those differently than plain word-based text.
Common Uses for a Token Counter
Checking a system prompt or long document fits inside a model's context window before sending it to an API, estimating API cost for a batch of prompts since most providers bill per token, and comparing how the same text tokenizes differently across GPT, Claude, and other models are all common reasons to check token count before running a request. As an llm token counter online, it works as a gpt token counter and a claude token counter side by side, a place to count tokens online, estimate tokens for gpt-4 style models, use it as a context window calculator, a tiktoken alternative online, a prompt token estimator, or simply an ai token calculator before you spend an API budget on a request that turns out to be too long.