Paste any prompt or document and instantly see an estimated GPT and Claude token count — plus characters, words and approximate API cost. Stay under context limits and budget prompts with confidence. Runs 100% in your browser; your text never leaves the page.
Large language models do not read words — they read tokens. A token is a chunk of text, usually a word fragment of roughly three to four characters of English, produced by a byte-pair-encoding (BPE) tokenizer. Common short words like "the" or "and" are a single token; longer or rarer words split into several. Crucially, everything about working with an LLM is measured in tokens: your prompt's length, the model's reply, the size of its context window, and the bill. If you build with or write prompts for GPT or Claude, knowing the token count of your text is the difference between a request that succeeds cheaply and one that gets truncated, errors out, or quietly costs more than you expected.
This token counter gives you that number instantly. Paste any text and it estimates the GPT and Claude token counts as you type, alongside character and word counts and an approximate input cost for the model you select. It is the quick gut-check you reach for before pasting a long document into a prompt, before shipping a prompt template, or when debugging why an API call hit a context-length limit.
The exact tokenizers used by OpenAI (tiktoken, with the o200k_base vocabulary for GPT-4o and newer) and by Anthropic for Claude rely on large learned merge tables — megabytes of vocabulary data. Shipping and running those in the browser for a quick estimate is overkill. Instead, this tool uses a fast BPE-style approximation: it splits text into the same kinds of atoms a real encoder sees — runs of letters, runs of digits, individual punctuation marks, and whitespace — and then applies per-atom token costs calibrated to match real tokenizer behavior. Words are merged into sub-word tokens at a rate close to the real vocabularies (GPT merges slightly more aggressively than Claude), digit runs are chunked, and non-Latin characters such as CJK and emoji are counted as costing more, which mirrors how real encoders behave.
The result is an estimate, and it is labeled as one throughout the interface. For ordinary English prose it typically lands within a few percent of the official counts — more than good enough for prompt budgeting and context-window checks. Where it can drift is dense source code, languages with non-Latin scripts, unusual Unicode, or text that is mostly punctuation. For those, or when you need an exact number for billing reconciliation, run the text through the official tokenizer. The counting happens entirely in your browser, so your prompts and documents are never uploaded.
Every model has a maximum context window — the combined token budget for your input plus the model's output. GPT-4o offers 128K tokens; Claude 3.5 Sonnet offers 200K. The context-fit bars in the tool show, at a glance, how much of each window your current text would consume on the input side. This matters because the input and output share one budget: if you fill 120K of a 128K window with input, you have left almost no room for the answer. Counting first lets you trim, chunk, or pick a larger-context model deliberately rather than discovering the limit through a failed call.
Counting tokens is one piece of operating in the AI-era web. If you run a website, decide how AI models may use your content with our AI robots.txt generator, and hand them a clean map of your best pages with an llms.txt file. Building an app that calls models directly? You will likely also want our sister developer utilities at fmt.hjlabs.in — a JSON formatter for inspecting API responses and a JWT decoder for debugging auth tokens. All of it is free and runs client-side.