LLM Token Calculator
GPT & Cost Estimate
Count tokens for supported GPT and reasoning models, compare tokenizer behavior, and estimate input or output cost from pasted text.
What is this tool?
This LLM token calculator estimates how a text sample is split into model tokens and uses the configured model pricing table to estimate input and output cost. Tokens are the accounting unit for most language-model APIs and also determine how much text fits into a context window.
Tokenization is model-specific. The same string can produce different token counts across GPT-4o, GPT-4.1, GPT-3.5, and reasoning model families because their vocabularies and merge tables differ. English, CJK text, emoji, whitespace, and code all behave differently.
Use this tool for prompt sizing, document chunking, quick cost planning, and comparing tokenizer behavior. Treat pricing as an estimate tied to the values configured in the application, and verify current provider pricing before making budget decisions.
How to use
- Paste the prompt, message, document chunk, or sample output.
- Select the model from the dropdown.
- Click Calculate to count tokens.
- Review token count, character count, and the cost estimate generated from the prices configured in this tool.
Examples
| Input / setting | Output | Notes |
|---|---|---|
gpt-4o + Hello world | 2 tokens; 11 characters | Short English sample. |
gpt-4o + antidisestablishmentarianism | 6 tokens; 28 characters | Long English word with multiple subword tokens. |
gpt-4o + function add(a, b) { return a + b; } | 13 tokens; 37 characters | Small code sample. |
Related tools & concepts
Last reviewed: 2026-05-08