Every other AI tool on this site takes a token count as input and refuses to guess at one. This is where the count comes from: a real BPE vocabulary, running in this tab, against the text you paste. Nothing is uploaded, and no approximation is involved.
Special token literals are counted as tokens, not as text
Sequences like <|endoftext|> and <|im_start|> are the delimiters a model uses to separate roles and messages. Written out in ordinary text they encode to a single control token rather than to their thirteen characters, so they cost almost nothing to count and can terminate or restructure a prompt. Most libraries refuse to encode them at all and throw instead, which is a guard rather than a solution. This page counts them the way the model would see them and tells you they are there, because the case that matters is text arriving from a user or a document rather than text you wrote.