Estimate tokens and input cost for GPT-4o, Claude Sonnet and Gemini Flash. Paste text to see characters, words, estimated tokens and editable prices.
Part of our Developer Tools collection — Explore more Developer Tools tools · See also: JSON Formatter, Base64 Encode / Decode.
Quick answer: AI Token Counter — Tokens + API cost Free, no signup, runs in your browser. See below for the interactive tool, 4-step guide and FAQs.
| Model | Price / 1M tokens | Est. cost |
|---|---|---|
| GPT-4o | $0.000000 | |
| Claude Sonnet | $0.000000 | |
| Gemini Flash | $0.000000 |
Reviewed by the Tool4SaaS Editorial Team — In-house reviewers who build and test every tool locally for accuracy across current Chrome, Edge, Firefox, and Safari. Last updated: . See our authors, methodology or contact us.
The tool divides character count by four, adds 15% when it detects code-like symbols or keywords, and rounds up. It is not tiktoken or a provider tokenizer. Four hundred ASCII characters usually estimate at 100 tokens; non-Latin text, emoji and code can differ substantially. Confirm billing in the provider dashboard.
GPT-4o at $2.50 per million input tokens, Claude Sonnet at $3.00 and Gemini Flash at $0.35. Every price is editable, so replace it with the current rate from your provider. Selecting a model changes the prominent cost card; the table shows all three costs.
No. The estimate covers input text only. Providers often charge a different rate for output, and reasoning models may bill additional tokens. Add the expected output and its rate separately if you need a full request budget.
No. Counting runs in the page and nothing is saved. The input is capped at 500,000 characters, and further typing is truncated with a warning. Redact secrets before pasting, especially on a shared computer.
Remove repeated instructions, shorten examples, summarize old chat turns and send only relevant document sections. Compare the estimate after each edit. Caching and batch discounts are provider features this tool does not model.
Counting approximates tokens, words, characters and API spend for GPT, Claude and Gemini prompts. Example 1: 400 characters approximate 100 tokens for quick budgeting. Example 2: 2000 words approach 2600 tokens, while 500 words near 650 tokens guide context planning. Editable price table shows dollars per million, like five dollars at 10k tokens equals five cents. Writers scope chapters, developers cap chat histories and founders forecast inference budgets. Chunk long documents, monitor context windows, and iterate prompts efficiently before committing to large runs across providers.
Reference heuristic table: prose averages four chars per token | code inflates due to symbols | 500 words near 650 tokens | 50000-token chapter estimates instantly | variance is largest for code, emoji and non-Latin scripts. Heuristic adds code uplift rather than exact tiktoken parsing. Edge case: multilingual text and emoji tokenize unpredictably, so verify critical budgets against playground counts. Pick a model to move the cost card, update the table when vendors change rates, and redact secrets before counting. Cache system prompts to avoid repaying repeated instructions. A 4,000-character prompt estimates at 1,000 prose tokens or 1,150 when the code boost applies; at $2.50 per million, that is $0.0025 or $0.002875.
Paste 500-word article, note characters, words, tokens near 650, select GPT-4o to see a fractional-cent cost, contrast Claude Sonnet at 2,000 tokens for a larger sub-cent estimate. Second trial: evaluate 50000-token chapter to forecast chapter spend. Limitation: heuristic only, billing demands dashboard confirmation, and pricing drifts over time. For word, sentence and readability counts, use /word-counter. The token estimate here is not a word count and does not measure reading ease. Recalculate when the model, price or prompt length changes; a saved estimate is only valid for the assumptions shown.