tokforge playground

Count and split text with GPT-2, GPT-4 and GPT-4o tokenizers. Same ids as tiktoken.

Text

Try

Token count

0tokens

 

Same text inTokensChars/tokenRelative size
Vocabulary—
Round trip from your browser—

Tokens

Type or paste text to see where the tokenizer cuts it.

Hover or tap a token to see its id and byte range.

Split into chunks

Cuts prefer a blank line, then a line break, a sentence end, a word. Every chunk is re-encoded to prove it fits.

Set a token budget and press Split.