File Token Calculator

iWebSeoTool File Token Calculator: Estimate how many tokens a file will use before you send it to an AI model — enter the file size, the share that is text and the characters per token, and see the tokens, the words and the cost.

This file token calculator estimates how many tokens a file will use before it is sent to an AI model — the file size, the share that is text and the characters per token. Enter your own figures and this token counter for files shows the estimated characters, tokens and words, plus what those tokens would cost — so the file is priced before a single token is sent.

The text share is the honest part of this calculation — only the text is tokenised, so a file that is mostly images can be far cheaper than its size on disk suggests. The figures are a model of your own numbers, not the provider’s exact token count. Everything runs in your browser.

Rate This Tool Your feedback helps others discover great tools
Not rated yet
👥 No ratings yet

Tap a star to rate:

Why Use Our File Token Calculator?

Cost Before You Send

Know what a file will cost before a single token is billed, not after the invoice arrives.

Text Share Priced In

The share that is text is counted separately, so images and formatting never inflate the token count.

Words Next to Tokens

The estimate is shown in characters, tokens and words, so any unit you think in is covered.

Free, With No Limits

Price every file, folder and document on your list, with no signup and no premium tier.

Common Use Cases for File Token Calculator

Large PDFs

Estimate the tokens in a long PDF before sending it to a model.

Code Repositories

Work out what a whole codebase would cost to send for review.

Ebooks and Manuals

Check whether a whole book fits in a model’s context window.

Monthly Budgets

Add up the files a team sends each month and price the total.

Model Comparisons

Compare what the same file costs on models with different prices.

File Trimming

See how much a file must shrink before it fits a token budget.

Understanding File Token Estimates

What is a File Token Estimate?

File token estimation turns a file’s size into a token count — the number of pieces an AI model reads — by counting the characters that are text and dividing by the characters per token, about four for plain English. The text share is the part of the file that is actually text, since images and formatting add bytes without adding tokens, and the estimated cost is the tokens divided by a million times the price per million tokens.

How Our File Token Calculator Works

  1. Enter the file size: Add the file size in megabytes and the share of it that is text.
  2. Set the token rate: Enter the characters per token and the price per million tokens.
  3. Read the estimate: See the estimated characters, tokens and words, plus the estimated cost — then trim or split the file if the figure is too high.

Where File Token Estimates Go Wrong

  • Counting every byte as text: A PDF full of images can be mostly non-text bytes, so the token count is far lower than the file size suggests.
  • One rate for every file: Code takes more tokens per character than prose, so a single rate misprices a mixed folder.
  • Forgetting the answer: The model’s reply is billed too, and a long summary can cost as much as the file itself.
  • Trusting the file size: Compressed files look small on disk but expand to far more text when they are read.

Privacy, Accuracy & Availability

Your figures are calculated in your browser and are never uploaded or stored. The token count is an estimate built on the rate and the text share you enter — it cannot match the provider’s tokenizer exactly, and no cost is guaranteed. It is free, with no account and no usage limits.

Related tools

Frequently asked questions

From the file size and the share that is text: a 2.5 MB file that is 90% text holds about 2,359,296 characters, and at four characters per token that is 589,824 tokens — roughly 442,368 words — costing about $1.77 at $3.00 per million tokens. The estimate assumes one byte is about one character, which holds for plain text.

Because only the text is tokenised — images, embedded fonts and formatting take up file size without adding tokens. A PDF that is mostly scanned images can be ten times the size of a plain-text file with the same token count, so guessing from the file size alone overstates the tokens.

It is the usual rule of thumb for plain English — about four characters, or three quarters of a word, per token. Code, numbers and other languages take more tokens per character, so set the rate to match your text: three for dense code, six or more for some other languages.

It is an estimate — words are taken as three quarters of a token, which is the usual English average. Short words, long words and technical terms all shift the real figure, so treat the word count as a guide and the token count as the number that matters for cost.

Because providers price input and output tokens differently, and this calculator prices the file as input tokens at the rate you enter. If the model also writes a long answer, that output is billed separately — and prices change, so check the provider's current price list.

Yes — add the file sizes together first and enter the total, with the text share as a rough average across the folder. For files that differ a lot, run them separately and add the token counts, since one average can hide a file that is mostly images.

No. The calculator runs entirely in your browser; the figures you enter are never uploaded or stored.