A million tokens, measured in

Code

Code is denser than prose per line but shorter per idea: a million tokens is roughly 100,000 lines — a real mid-sized codebase, or the original Doom engine twice over.

Code tokenizes differently from prose. Whitespace, brackets, and camelCase identifiers all affect the token count, and most code averages about 10 tokens per line compared to prose at roughly 20 tokens per sentence. For engineering teams evaluating AI code assistants, the question is straightforward: can the model see enough of your codebase in a single pass to give useful answers? A hundred thousand lines covers a mid-sized production service.

Common questions about code

What would this cost?

Everything on this page is exactly one million tokens. So the price of having a model read — or write — all of it is simply each model's per-million rate. Updated 2026-07-28.

ModelRead all of it (input)Write all of it (output)
GPT-5.6 Sol$5$30
GPT-5.5 Pro$30$180
Claude Fable 5$10$50
GPT-5.6 Terra$2.50$15
GPT-5.5$5$30
Claude Opus 4.8$5$25
Claude Sonnet 5$2$10
Gemini 3.1 Pro$2$12
Gemini 3.5 Flash$1.50$9
GPT-5.6 Luna$1$6
Claude Haiku 4.5$1$5
Gemini 3 Flash$0.50$3

From $0.50 to $180 for the same million tokens. Try your own budget in the calculator →

Frequently asked questions

How many lines of code is 1 million tokens?
Approximately 100,000 lines of source code, since code averages about 10 tokens per line.
How many lines of code is 1M tokens?
About 100,000 lines — nearly twice the original Doom engine (57,000 lines).
1 million tokens to lines of code — how does it convert?
At roughly 10 tokens per line of code, 1 million tokens equals about 100,000 lines. This is a mid-sized production codebase.

The same million tokens, measured differently

Or start over with the full picture — scale, prices, and the budget calculator.

From the blog