LLM Token Counter

Paste any prompt or document and see exactly how many tokens it uses — with the same tokenizers GPT, Qwen, GLM, Kimi, and MiniMax actually run on. Inspect the split token by token, switch encodings, and budget against context windows. Your text never leaves the browser.

tokens

o200k_base · For GPT-5 · GPT-4o · o-series
Encoding

Count tokens exactly with the official vocabularies of GPT, Qwen, GLM, Kimi, and MiniMax, inspect the split and IDs token by token — all locally in your browser.

Browser-side

How to use LLM Token Counter

Step 1

Paste or type any text

Step 2

Pick the encoding: OpenAI's two, or Qwen/GLM/Kimi/MiniMax

Step 3

Read the live count and the colored token split

Features

Official vocabularies for GPT and Qwen/GLM/Kimi/MiniMax, not an approximation

Token-by-token split with IDs

see where every token goes

Runs locally in your browser, nothing is uploaded

Exact token counts from six official vocabularies

The Complete Guide to Token Counting

What this tool does

The token counter splits text with the same BPE encodings OpenAI models use and counts the result. Tokens are the common currency of the LLM world — APIs bill by them, context windows cap them, and models read by them. Whether you are writing prompts, chunking for RAG, or estimating costs, step one is knowing what your text actually costs in tokens.

How to use it

  1. Paste your textPrompts, documents, or code — the longer it is, the more it pays to count first.
  2. Pick the right encodingo200k_base for GPT-5/4o/o-series, cl100k_base for GPT-4/3.5.
  3. Read the countCounting is live as you type; the encoding table loads once and stays.
  4. Inspect the colored splitAdjacent tokens alternate colors — see at a glance what shatters and what stays whole.
  5. Check token IDs if neededSwitch to the ID view for the actual integer sequence the model receives.

Specs & limits

Input
No file upload
Encodings
OpenAI ×2 · Qwen3.5 · GLM-5.2 · Kimi · MiniMax-M3
Count basis
Real BPE, not estimated
Split view
First 1500 tokens colored
Count limit
None (full text)
Works offline
After the table loads

Counts are exact against the official vocabularies of OpenAI (GPT family) plus Qwen3.5, GLM-5.2, Kimi, and MiniMax-M3. Claude and Gemini keep their tokenizers private, so treat those as ballpark. Vocabularies are 1–4MB, downloaded once on first use and cached after.

Tips for best results

  • Chinese costs more than EnglishThe same meaning often takes 1.5–2× the tokens in Chinese — budget per language in multilingual apps.
  • Code shatters into piecesIndentation, symbols, and camelCase all add tokens — count before pasting a large file.
  • Leave room in the windowInput and output share the context window; a prompt at the limit leaves no room for the answer.
  • System prompts bill tooThey are resent on every request — a long system prompt is a hidden recurring cost.
  • Chunk RAG by tokensChunking by tokens instead of characters keeps retrieval snippets consistently dense.
  • Mind structural tokensChat formatting adds a few structural tokens, so real usage runs slightly above the text count.

Why Tosea.ai

Characters ÷ 4 estimate

Barely works for English, badly wrong for Chinese and code.

API usage field

Exact but costs a paid call — useless while drafting a prompt.

Tosea.ai counter

Same encodings, exact and local, live as you type, free.

Treat tokens as a budget and your prompts get both sharper and cheaper. Pair this with the LLM API fingerprint checker to verify your endpoint is genuine, or convert PDFs into presentations with AI — build and verify your AI workflow in one place.

Related tools

FAQ

LLM Token Counter FAQ

These answers explain what the tool does, what files it supports, and where the current limits are.

What exactly is a token?
Tokens are the chunks a language model actually reads — usually a few characters, sometimes a whole word. Common English words are often one token, while rare words, code, and non-Latin scripts split into more. API pricing and context limits are all measured in tokens.
Which encoding should I choose?
o200k_base covers GPT-5, GPT-4o, and the o-series; cl100k_base covers GPT-4 and GPT-3.5. For Qwen, GLM, Kimi, and MiniMax just pick the vocabulary of the same name. If unsure, use o200k_base.
Does the count apply to Claude or Gemini?
Qwen3.5, GLM-5.2, Kimi, and MiniMax-M3 ship with their official vocabularies, so counts are exact. Claude and Gemini keep their tokenizers private — treat those numbers as a ballpark: rough token budgets still transfer across models.
Is my text uploaded to a server?
No. The tokenizer runs completely in your browser. The encoding table is downloaded once as a static file, and your text never leaves your device.
LLM Token Counter — Count GPT Tokens Online | Tosea.ai