π€ AI Token Calculator
Count tokens and estimate API costs for any model
About this calculator
AI models charge by the token, not the word, and this calculator estimates token counts before you spend. Paste or type your text β prompts, documents, chat histories β and it approximates tokens using the standard rule of about 0.75 words per token for English, with adjustments for code, other languages, and formatting-heavy text.
Tokenizers split text into chunks averaging 4 characters in English. Multiply your estimated tokens by a model's per-million-token price for input and output separately, since output tokens typically cost two to four times more than input tokens.
Tip: Long system prompts and few-shot examples burn input tokens on every single call β trimming a 2,000-token system prompt saves real money at scale.