Token Counter
Paste text, or upload a text or code file, and see an estimated token count for GPT, Claude, or Gemini. The same approximation is used for each family, so the token number does not change when you switch. Characters and words update as you type. The text and the file stay in this browser.
Estimate for GPT. The same rule is used for every family: about 4 characters per token, rounded up. Switching family does not change the token number. This is not a certified count for every current or future model.
Your text never leaves this browser. A file you open is read here too, and is not uploaded.
Drop a text or code file on the box, or use Upload file. PDF, Word, and other binary files are not supported yet. The limit is 5 MB.
- TokensEstimate
- 0
- Characters
- 0
- Words
- 0
Cost estimate
Uses the number you type. This page does not include a vendor price list. Input and output rates often differ, so run it once for each rate.
Enter a price per 1 million tokens to estimate cost.
Every token figure on this page is an estimate for the family you select. It is not certified for every current or future model, and it is not a vendor bill. A chat API can add tokens for message framing that are not in the box. Your text stays in this browser.
How to use this token counter
- Choose GPT, Claude, or Gemini. The token number uses the same estimate for each family.
- Paste text, type, or press Upload file. You can also drop a text file on the box. The file is read in this browser and is not uploaded.
- Read the Estimate badge next to Tokens. The number is approximate, not a certified count for every model in that family.
- To price a call, type what you pay per 1 million tokens. The page does not keep a price list.
- Press Clear text to empty the box. This page does not save what you pasted or the file you opened.
Features
- Estimates tokens for the GPT, Claude, and Gemini families with one rule: about 4 characters per token, rounded up.
- Shows characters and words beside the token estimate.
- Reads a text or code file in this browser, up to 5 MB. The file is not uploaded. PDF and Word files are not supported.
- Estimates cost from a price you type per 1 million tokens. This page does not include a vendor price list.
- Labels the token figure as an estimate. It is not a certified count for every model and it is not an API bill.
What a token is
A token is a chunk of text a model reads. It is not always a word. Common words are often one token. Longer or less common words are split. Spaces and punctuation are part of the count.
This page does not run a separate tokenizer for each family or model version. It estimates the length of the text in the box. “hello world” is 11 characters and 3 estimated tokens.
Why this count is an estimate
GPT, Claude, and Gemini do not share one vocabulary, and a later model in the same family can split text differently from an earlier one. A figure that matches one model can miss another.
The selector names the family you have in mind. The token number itself uses one rule for all three, so switching family does not change it. The page does not invent a gap between vendors.
The estimate does not add tokens for roles, tools, images, or a system message you did not paste. It is a rough length, not a bill.
How the estimate is calculated
Characters are Unicode code points, the same rule as the character total and the word counter. A single emoji such as “😀” is one character. The estimate is zero when the box is empty. Otherwise it is the character count divided by 4, rounded up.
“hello world” is 11 characters, so the estimate is 3 tokens. Code, emoji, and many languages other than English can land far from that guess. An emoji can be one character and several tokens, so the estimate can be low. The badge says Estimate for GPT, Claude, and Gemini.
How cost is estimated
Type a price per 1 million tokens. Cost equals the estimated token count divided by 1,000,000, then multiplied by that price. The page does not store OpenAI, Anthropic, or Google prices, because they change and they differ for input and output.
If you are pricing a reply, count the prompt and the completion separately and type the rate that applies to each. The box holds one price at a time.
What this counter does not do
It does not call an API, log the text, or save a draft. Closing the tab clears the box.
It does not open PDF, Word, or other binary files. Those are not supported yet. A text or code file up to 5 MB can be read in this browser. It also does not apply cached-input discounts or batch rates. Type the price you actually want to use.
Word and character totals follow the same splitting rules as the word counter. Use that page when you want sentences, paragraphs, and a reading time instead of tokens.
Privacy
The text never leaves your browser. A file you choose is read on this device and is not sent to BabelDoc. Counting does not download a tokenizer. Closing the tab clears the box.
If analytics is on, it measures the visit, not the text. The privacy policy describes the site-wide rules.
Frequently asked questions
Is my text uploaded?
No. Typing, pasting, and opening a file all stay in your browser. The file is not sent to BabelDoc and is not saved by this page.
Can I upload a file?
Yes. Use Upload file, or drop a file on the text box. Text and code files are supported, including .txt, .md, .csv, .json, .html, .xml, .yaml, and source files such as .py, .js, and .ts. The limit is 5 MB. PDF, Word, and other binary files are not supported yet. The file is read as UTF-8 in this browser and is not uploaded.
How accurate is the token count?
It is an estimate for the family you select, not a certified count for every current or future model. The rule is the character count divided by 4, rounded up. The same rule is used for GPT, Claude, and Gemini.
Why does the count stay the same when I switch family?
The selector records which family you are estimating. It does not apply a different formula. GPT, Claude, and Gemini can tokenize differently, and this page does not invent a separate number for each.
Will this match my API bill?
Do not expect it to. The estimate can miss the vendor’s own split, and an API request can add framing you did not paste, such as role labels. Use the vendor’s usage page when the bill matters.