Fastsoft

Text

LLM Token Counter

Count text tokens with OpenAI encodings and inspect color-coded tokenization.

LLM Token Counter
Count text tokens in your browser and display the tokenized text in color.

Text is processed in your browser and is not uploaded.

Token count

0

Characters

0

Color-coded token preview

Enter text to see color-coded tokens here.

Characters spanning multiple tokens use the color of their first token. The ID list below still includes every token.

Token ID list

No tokens yet

This counts input text only. Real API usage may include message formatting, tool calls and multimodal content; other models may use different encodings.

Fastsoft / Guide

Practical guide

Count input text with local o200k_base or cl100k_base tokenization and use alternating colors to show token boundaries. Processing stays in your browser.

How to use it

  1. Type or paste the text to analyze.
  2. Choose an encoding and inspect the total count, color preview and token IDs.
  3. Hover over a colored segment to see its ID. Long texts preview only the first 500 tokens, while the total count remains complete.

Example

Paste a prompt containing English and Chinese, then switch encodings to compare the total count and segmentation.

What to know

Only the editor text is counted. Chat formatting, tool calls, images, audio and other overhead are excluded; other models may use different encodings. Some Unicode characters span multiple token byte sequences, so the preview colors them by the first token while the ID list keeps every token.

Common question

Why are there sometimes fewer colored segments than tokens?

A Han character or emoji may span bytes from multiple tokens. The preview keeps the character intact and gives it the first token’s color. Every token ID still appears in the list below.

Related tools