The visual tokenizer

Text to tokens.

A prompt, a paragraph, a little code. See the pieces your text becomes—and the numbers behind them.

Free. Local. No sign-up.

Tokens

—

After tokenization

Words

2

Language-aware count

Characters

13

Including spaces & line breaks

UTF-8 bytes

13

Original text size

Try an example

Click Clear all to empty this box, then type or paste your text.

Plain text · 50,000 characters max13 characters

02Tokenized

Preparing GPT-4o / GPT-4.1…

The first use may take a few seconds. Your text stays here.

Look a little closer

Select a colored piece to see its token ID and UTF-8 bytes.

Your text stays in this tab. No uploads or API keys.

— characters / token

01 /

A word is not a token.

Common words may stay whole. Unusual words can split into several pieces. The actual encoding decides.

02 /

The little things count.

Spaces, line breaks, punctuation, and code indentation are part of the text—and part of its token count.

03 /

Same text. Different count.

Switch models to compare boundaries. Different vocabularies can represent the same sentence with different tokens.

From tokens to dollars

What would those tokens cost?

Compare input and output prices across our model catalog.

Compare pricing

A few useful details

Behind the pieces.

Built with gpt-tokenizer and Hugging Face Tokenizers. OpenAI encodings and official Qwen3 / DeepSeek R1 vocabularies run in your browser.

What does a token actually represent?

A token is a vocabulary entry represented by a numeric ID. It can contain a whole word, part of a word, punctuation, whitespace, or just some of the UTF-8 bytes in a character. Select a colored piece above to inspect its ID and bytes. A linked piece with a ×2 badge contains two tokens that share a character or emoji.

Which tokenizer should I choose?

Choose the model you are working with: GPT-4o / GPT-4.1 uses o200k_base, original GPT-4 / GPT-3.5 uses cl100k_base, and GPT-oss uses o200k_harmony. Qwen3 uses the official Qwen3-0.6B tokenizer; DeepSeek R1 uses the original official R1 tokenizer. These are pinned releases, not a universal count for every model or version. The same plain text can have the same IDs across related OpenAI encodings.

Can I use this for Claude or Gemini?

Claude and Gemini are not included in this visualizer yet. Their token counts can differ from the tokenizers listed here, so an OpenAI count should not be treated as an exact substitute. Use the provider's official token-counting tools when you need a count for those models.

How are words and characters counted?

Words use language-aware segmentation, including for text without spaces such as Chinese and Japanese. Characters are Unicode code points, including spaces and line breaks. A visible emoji may contain several code points. UTF-8 bytes measure the encoded size of the original text. Qwen3 applies Unicode NFC normalization, which can combine an accent and a letter; a notice appears when the token preview differs from your original input.

Is this my complete API token usage?

This tool counts the plain text you enter with the selected tokenizer, without automatically adding beginning/end tokens or a chat template. Qwen3 and DeepSeek recognize their vocabulary's special markers if you type them; the OpenAI options treat special-looking strings as literal text. An API request may also include message formatting, system instructions, tool definitions, images, and other content. Those can add to the provider's billed input; generated output is billed separately.

Is my text stored or sent to a server?

Tokenization runs locally in your browser. This tool does not upload or store your input, and it does not need an API key. Reloading or closing the tab clears the text you entered. You can inspect up to 50,000 characters at a time.