Count tokens for GPT-4, Claude, Gemini, and Llama. Uses the same tokenizer as OpenAI.
Three steps. Instant results.
This tool uses js-tiktoken (the JavaScript port of OpenAI's tiktoken) with the cl100k_base encoding — the same tokenizer used by GPT-4 and GPT-4o. It splits your text into BPE (Byte Pair Encoding) tokens, counting the exact number of tokens that the model will process. For other models like Claude and Gemini, it applies ratio adjustments based on known tokenizer differences. The tokenizer loads once and runs entirely in your browser.