Token Counter
Free online Token counter, no installation required. Calculate OpenAI model tokens and estimate API cost
What is Token Counting?
Tokens are the basic units that AI models like GPT-4 and GPT-3.5 use to process text. One token roughly corresponds to 4 characters in English, or about ¾ of a word. Different models use different tokenizers — for example, GPT-4o uses the o200k_base encoding while GPT-4 uses cl100k_base. Knowing the token count of your prompts helps you stay within model context limits and estimate API costs.
How to Use the Token Counter
1. Select the encoding that matches your target model (e.g., cl100k_base for GPT-4). 2. Type or paste your prompt text into the input area. 3. The token count updates in real time as you type. 4. The tool also shows character count, word count, and line count for reference.
▶Which encoding should I use?
▶How accurate is the token count?
▶Does this tool send my text to any server?
▶Can I count tokens for Claude or other models?
If this tool helped you, consider buying the author a coffee.
Buy Me a Coffee