Token Counter
Estimate tokens & costLoading...
Related:String Inspector
Tokens are the fundamental units LLMs use to process text. A token roughly maps to 4 English characters — the word "hamburger" becomes 3 tokens. Different models use different tokenizers: GPT-4o uses o200k_base while GPT-4 uses cl100k_base, producing different counts for the same input.
API costs are calculated per token — typically priced per million tokens, with output tokens costing more than input. Counting tokens before sending requests helps optimize prompts and predict costs across models like ChatGPT, Claude, and Gemini.