gizmobench
BrowseDaily

Token Counter

Paste plain text, code or Markdown to count its tokens with the selected local BPE encoding. The plain-text mode counts the text value without further Unicode or whitespace normalization and shows token IDs; o200k_base and cl100k_base can produce different splits. Rough estimates for Claude, GPT-style text and Llama remain available separately. Neither mode measures an account’s remaining usage or a complete API request.

Plain-text token IDsCounting…

Loading the selected local vocabulary and counting in a background worker…

Plain-text tokens
Counting…

Raw plain text. The selected bundled BPE encoding counts the text value without further whitespace or Unicode normalization. Your browser may standardize pasted line endings in the text box. Special-token-looking strings are treated as ordinary text. This does not count complete API messages, roles, tools, schemas, PDFs, images, audio or account usage, and it does not determine a bill. Match the encoding to your model and use the provider's counter for a complete request.
Local text. Pasted text stays in this browser. The vocabularies are downloaded as site assets; counting does not send your text to an API. There is no fixed paste ceiling. Browser memory is the practical limit. Selected settings and drafts up to 50,000 characters can be remembered on this device.

Common questions

What is a token, and why is it different from a word?
A token is a unit a model reads, often a word fragment with attached whitespace or punctuation. A single word may become several tokens, and one Unicode character can span token boundaries. There is no fixed conversion from a word count or character count to tokens; count the actual text using the appropriate encoding.
What is counted exactly in plain-text mode?
The selected bundled BPE encoding tokenizes the complete text value, including its whitespace and Unicode composition. The browser may standardize pasted line endings in the text box; the tokenizer makes no further line-ending or Unicode changes. o200k_base and cl100k_base use different vocabularies. Strings that look like special control tokens are treated as ordinary text. The displayed token total is for this plain text and encoding, not a complete model request.
Which encoding should I use for OpenAI text?
The OpenAI Cookbook lists o200k_base for GPT-4o and GPT-4o mini and cl100k_base for GPT-4, GPT-4 Turbo, GPT-3.5 Turbo and the listed text embedding models. Match the encoding to your specific model. Other model names are not automatically resolved by this page, and message formatting, tools, schemas and multimodal inputs add tokens beyond raw text.
Is the Claude or Llama count exact?
No. Rough estimates use a local character, script and punctuation heuristic rather than either provider’s model vocabulary. There is no fixed measured error range for your input. Use the provider’s model-specific counter before a hard context limit. This page does not read Claude Code, claude.ai, ChatGPT or a billing account.
Can I calculate API prices or see my remaining tokens?
No. This counter supplies a plain-text token count or a rough estimate. It does not load current model prices, compute cached or output-token charges, track a conversation’s usage, access an account’s quota or determine a bill. A complete API request can contain additional formatting, tools, images, files and reasoning-related tokens.
Can it read a PDF or count image tokens?
It accepts pasted plain text, code and Markdown. It has no PDF, document or image importer and does not perform provider-specific multimodal tokenization. Extract text with a suitable utility before pasting it here if you only need the extracted plain-text count; that is not a count of a model’s full PDF or image input.
Are text, model settings and large drafts kept locally?
Your text is counted in this browser; the selected vocabulary loads as site assets and the text is not sent to a token-counting API. Settings and drafts up to 50,000 characters can be remembered on this device. Longer text is counted in full but omitted from storage. There is no fixed paste ceiling, and a shortened token-ID preview does not shorten the count.

Named BPE encodings count raw plain text locally. Complete API requests add message, tool and multimodal tokens that are not counted here. Claude, GPT-style and Llama heuristic estimates have no fixed measured error range and are not model-specific provider counts.