Blue team · Lab

Tokens: count them, break them, budget them

See text become tokens, understand why token counts differ by content type and model, and connect tokens to both cost and the context window.

~30 min · Browser tokenizer + LM Studio · 6 steps

New to AnythingLLM? Do the one-time setup first — it takes about five minutes.

  1. Open Tiktokenizer or the Hugging Face Tokenizer Playground (links on the Resources page). No install needed.

  2. Paste a paragraph of ordinary prose and note the token count and the character-to-token ratio.

  3. Now paste the same length of: source code, a base64 blob, a hex string, and a few emoji. Compare counts.

  4. Paste a word like "cybersecurity" and watch where the split lands.

  5. Switch tokenizers (different model families) with identical text and compare the totals.

  6. In LM Studio, load a small model and hold a short conversation, watching the context/token usage indicator climb as the conversation grows.

What to notice