Count tokens and budget a context window: exact counting for the GPT families, calibrated estimates for Claude 5, Gemini and Llama, and a warning past the 272K pricing step
By default the estimate splits text into Latin words, CJK characters, digits, punctuation and emoji: English prose usually lands within five percent, code runs about ten percent low, Chinese can drift fifteen percent. Turn on exact mode and the GPT families count with their official vocabulary (about 1 MB on first load), while the breakdown stays an estimate; Claude, Gemini and Llama publish no vocabulary, so they stay estimated. In the budget below, the reserve is the room you leave for the model, and the rest is what the prompt may use.