Online tokenizer

Count tokens online by AI model

Paste text into the tokenizer family that matches your model. Get a real token count, inspect token pieces and IDs when available, and understand when a plain-text result will differ from an API total.

Choose the right count

Tokenizer results depend on the model family

There is no universal token count for the same text. Use the matching tokenizer when you need a model-specific input total.

Local tokenizers

OpenAI, Gemini, Gemma, Llama, Qwen, Mistral, and DeepSeek

These pages run their pinned tokenizer assets in your browser and show the produced pieces and IDs. StackLens does not upload the text.

Claude

Official API input count

The Claude option uses Anthropic's token-count endpoint, so the submitted text is sent to Anthropic for counting. StackLens does not store it.

Plain text boundary

Count first, estimate second

Roles, tools, chat templates, images, and retries can change an API bill. Use the measured count in the API cost calculator for scenario planning.

FAQ

Online tokenizer questions

Which online tokenizer should I choose?

Choose the model family that will process the text. Token boundaries and IDs are specific to a tokenizer, so the same text can have a different count in another family.

Do these tokenizers upload my text?

OpenAI, Gemini, Llama, Gemma, Qwen, Mistral, and DeepSeek tokenization runs locally in your browser. Claude uses Anthropic's official token-count API and sends the submitted text to Anthropic for counting; StackLens does not store it.

Will a plain-text tokenizer match an API bill exactly?

Not always. Roles, chat templates, tool definitions, images, and provider-specific request formatting can add tokens beyond the plain text entered into a tokenizer.