AI Calculator Pro

How many tokens is my codebase, and what does it cost?

To estimate the token count and cost of a codebase, you first have to understand how your text maps to tokens. Built for teams doing repo-level AI, this tool makes the token math concrete so your budgets and context planning are based on real numbers.

Results update automatically as you type.

Result
~409,091 tokens
200 files · $0.8182 to send once to GPT-4.1
Total characters
1,350,000
Estimated tokens
409,091
Input cost (once)
$0.8182

Why this isn't trivial

The part people underestimate: whole codebases are far larger than the context window, so you pay heavily and must select what to include. In practice the biggest savings come from indexing with RAG and sending only relevant files, so it is worth modelling before you commit.

How it's calculated

We estimate this by estimating repo tokens from file sizes and pricing what fits at the input rate. Every figure uses the current provider prices baked into the site (reviewed daily), and you can override any input to match your own assumptions.

Frequently asked questions

Can I send my whole repo?+

Rarely — it exceeds the window; retrieve only relevant files.

What's the cheaper approach?+

Embed the repo and retrieve just what each task needs.

Are these prices up to date?+

Yes. The model prices behind this calculator are refreshed and reviewed daily, so your estimate reflects current provider rates rather than a stale snapshot.

Related

Estimates for planning. Pricing data last reviewed 28 July 2026.