BeginnerAbout 15 min

    Tokenization & Encoding (Tiktokenizer)

    Read the full article on Substack

    6 min read.

    Interactive tokenizer for OpenAI models - see how text is broken into tokens and encoded. Perfect for understanding GPT tokenization.

    Training words24 tokens
    • _low
      seen 5 times
    • _lower
      seen 2 times
    • _newest
      seen 6 times
    • _widest
      seen 3 times
    Most common neighbouring pairs
    e + s9 times, merge this
    s + t9 times
    w + e8 times

    Start with every word as single characters. Count each neighbouring pair: e + s is the most common, 9 times.

    1/9

    Check your understanding

    Answer from memory before you scroll back up. Pulling an idea out of your head is what makes it stay there.

    Text to model input

    Sequence

    Order the encoding path.

    Tap a piece, then tap where it goes — or drag it. Tap the tray to take one back.

    1. 1Drop a step here
    2. 2Drop a step here
    3. 3Drop a step here
    4. 4Drop a step here
    5. 5Drop a step here
    5 pieces left to place

    Quiz

    20 questions
    Question 1 of 20
    Score: 0

    Tokenization is the process of…

    Done with this lesson?

    Sign in free to keep your progress, streak and quiz scores.

    Keep going