Under the hood

Token by Token

How a chatbot writes its reply

Ask a real AI model a question. Then step through how its reply was made, one token at a time, using the real data behind it, with every value labeled.

The options for the next token

  1. "Sun"
  2. "light"
  3. space, "contains"
  4. space, "many"
  5. space, "colors"
  6. ","
  7. space, "but"
  1. ␣air40.3%picked
  2. ␣as40.3%
  3. ␣Earth15.9%
  4. ␣when2.04%
Recorded tokens, reported by OpenAICalculated percentages, from its logprobsFrom the sample conversation, recorded 2026-09-30Recorded: Measured by this app (browser) with gpt-6-lunaRecorded: Reported by OpenAI

What you’ll see

  1. Tokens

    Text is split into : often a whole word with its leading space, sometimes a piece of one, like building blocks of text. AI services count tokens, not words: a model can take in , each reply is capped at a set number, and every request is priced by the token.

    1. "Why"13903
    2. space, "is"382
    3. space, "the"290
    4. space, "sky"17307
    5. space, "blue"9861
    6. "?"30

    Calculated tokens and IDs, split by this app’s tokenizer

    See it in the sample
  2. A weighted random pick

    At every step the model the options for the next token. One is , like a raffle where likelier options hold more tickets, so the top option doesn’t always win.

    1. space, "Dust"
    2. space, "and"
    3. space, "tiny"
    4. space, "particles"
    5. space, "can"
    1. ␣intens39.4%
    2. ␣scatter26.2%
    3. ␣enhance16.2%picked
    4. ␣deepen5.57%

    Recorded tokens, reported by OpenAICalculated percentages, from its logprobs

    See it in the sample
  3. Context, not memory

    With each message, this app sends the again, with its own , like handing over the whole transcript each time. Chatting doesn’t change the model.

    1. InstructionsYou are the assistant on Token by Token, an educational website that shows how language models generate text one token at a time. Answer helpfully, accurately, and concisely, usually in under 150 words and in plain language. Use Markdown only when it helps. If you aren't sure about something, say so. You have no tools, no internet access, and no memory of other conversations.80 tokens
    2. YouWhy is the sky blue?6 tokens
    3. AssistantSunlight contains many colors, but air molecules scatter shorter wavelengths more than longer ones. Blue light has a shorter wavelength than red light, so it gets scattered in all directions across the sky and reaches your eyes from everywhere. That’s why the daytime sky looks blue.53 tokens
    4. YouWhy are sunsets red, then?7 tokens

    Recorded text, sent by this appCalculated token counts

    See it in the sample

What’s real here

Every value carries one of four labels, always as a word, never just a color:

Recorded
Sent, done, or measured by this app, or reported by OpenAI, for your conversation.
Calculated
Computed here from recorded values, with the method named.
Reference
Documented facts, such as the model’s context limit, with a source and a date.
Example
A teaching drawing, not measured from the model. Views of the network’s insides are always examples: OpenAI hasn’t published the design of its hosted models.

A What-if tag marks anything simulated on the page. The model wasn’t asked again.