How to Count AI Tokens
Count tokens for GPT, Claude, and other LLM APIs instantly. Estimate API costs, check context window limits, and optimize your prompts with our free token counter.
Open Token Counter →Step-by-Step Guide
Paste your text or prompt
Enter or paste the text you want to tokenize into the input area. This can be a prompt, system message, API request body, or any text content. The tool handles multi-line text, code blocks, and special characters accurately.
Select the model or tokenizer
Choose the target model to get accurate token counts — different models use different tokenizers. GPT-4 and GPT-3.5 use cl100k_base, while Claude uses its own tokenizer. The token count can vary significantly between models for the same text.
View the token breakdown
See the total token count along with a visual breakdown of how your text is split into tokens. This helps you understand why some words use more tokens than others — for example, uncommon words often get split into multiple tokens.
Estimate API costs
Based on the token count and selected model, the tool calculates the estimated API cost for input and output tokens. Use this to budget your API usage, optimize prompt length, and ensure you stay within context window limits.
Try It Now — Free
No signup, no download. Runs entirely in your browser.
Open Token Counter