How Many Lines of Code Is 1 Million Tokens?

One million tokens is roughly 100,000 lines of source code. Code averages about 10 tokens per line — nearly twice the original Doom engine.

Why this matters

For engineering teams, token capacity directly determines how much source code an AI assistant can review, refactor, or generate in a single pass. Understanding the token cost of code versus prose helps you choose the right model and context window for code review, migration, and automated testing workflows.

≈ 100,000 lines of code lines of source code, drawn to scale

1 block = 100 lines of code

The answer

≈ 100,000 lines of code

lines of source code

The math

Basis assumption

~10 tokens per line

Calculation

Code averages roughly 10 tokens per line, so a million tokens is about 100,000 lines — nearly twice the original Doom engine (~57,000 lines).

Result

1,000,000 tokens = 100,000 lines of source code

Real-world references

To put this in perspective, here are some well-known examples for comparison.

See also

Explore further