We Value Your Privacy

We use cookies to enhance your browsing experience and analyze site traffic. All calculations happen locally in your browser - we never see or store your data. Learn more in our Privacy Policy

/
/
CalculateYogi
  1. Home
  2. Technology
  3. Token Count & Word Converter
Technology

Token Count & Word Converter

Convert tokens to words, pages, characters or lines of code for GPT-5, Claude and Gemini. Exact tiktoken counts for OpenAI models.

Common questions
What do you have?

Quantity

Enter a number and say what it counts. Every other unit is filled in for you, so it works in both directions.

Model

Token counts for Claude, Gemini and other non-OpenAI models are estimates: those providers do not publish their tokenizers, so the figures come from their own documented characters-per-token guidance. Use the provider's API for billing-exact counts.

Did this calculator solve your problem today?

Contributor

Reviewed by

Last updated: August 22, 2026
SupportI build these free tools with love, late nights, and way too much coffee. If this calculator helped you, a small donation would mean the world to me and help keep this site running. Thank you for your kindness!

Related Calculators

You might also find these calculators useful

Context Window Calculator

See whether your prompt fits an LLM context window

Prompt Cost Calculator

Price one LLM API call and compare it across every model

LLM API Cost Calculator

Monthly LLM API bill with caching and batch discounts

Model Size Calculator

Parameters, VRAM and GPU fit from a model's real architecture

Tokens, in the units you actually think in

You know your document is 2,000 words, or 300 pages, or 5,000 lines of code. What you need is the token count, because that is what a context window is measured in and what an API bills for. This calculator converts in both directions between tokens and words, characters, pages and lines of code — and when you paste text into an OpenAI model, it counts with the real tokenizer instead of estimating.

What is a token, and why is it not a word?

A token is the unit a language model reads. Tokenizers are trained on text, so common words are usually a single token while rare words, long numbers, code punctuation and non-English characters split into several. That is why no single characters-per-token number is right for everything: English prose runs about 4.4 to 5.6 characters per token, real source code about 4.1, and Chinese between 1.4 and 2.0. Providers publish an average, and this calculator uses each provider's own figure rather than one rule for all of them.

The conversion

How to use it

1

2

3

4

5

What people use this for

Will this document fit?

Convert a page count to tokens before you paste a report, contract or manuscript into a model with a fixed context window.

Budgeting an API bill

Token counts are what you are charged for. Converting your expected monthly word volume to tokens is the first step in any cost estimate.

Sizing a codebase for review

Lines of code convert to tokens at a much worse rate than prose. Check before you try to feed a repository to a model.

Comparing providers fairly

The same prompt is a different number of tokens on each provider. Comparing prices per token without comparing token counts gives you the wrong answer.

Why the flat "4 characters per token" rule keeps letting people down

Claude 4.7 changed the ratio

Anthropic states that its current tokenizer produces roughly 30% more tokens for the same text than older Claude models. A prompt sized against the old 3.4 characters per token figure is about 36% larger than expected on a current model.

Code is not prose

Code is denser than its character count suggests. Measured across 1,067 lines of real TypeScript from this site (52,750 characters), OpenAI's tokenizer averaged 4.1 characters per token and about 12 tokens per line — punctuation, indentation and unusual identifiers all cost more than an ordinary English word.

Non-English text costs more

The same twelve Chinese characters are 6 tokens under OpenAI's o200k_base and 11 under the older cl100k_base. A multiplier cannot capture that, because the two tokenizers disagree by 1.8x on identical input.

The direction you need is usually backwards

Most tools count tokens in text you already have. The commoner question is the other way round: you know the window is 200,000 tokens and you want to know how many pages fit.

Frequently asked questions

About 750,000 words on OpenAI models, which publish 0.75 words per token. On Claude 4.7 and newer it is about 555,000 words, because Anthropic's current tokenizer is denser — the same million-token window holds roughly a quarter fewer words.

Taking a page as 500 words, a 300-page book is about 150,000 words: exactly 200,000 tokens on an OpenAI model and about 270,000 on Claude 4.7. That is the awkward case — it fills a 200,000-token window precisely, leaving no room for the model's reply, and overflows the same window outright on current Claude.

Taking a line as 40 characters including indentation, about 10 tokens by OpenAI's published 4-characters-per-token figure. Measured on 1,067 lines of real TypeScript the actual average was about 12 tokens per line, so treat the converted figure as a floor rather than a ceiling — code carries more punctuation and more unusual identifiers than prose does.

It is a reasonable average for English prose and wrong for almost everything else. Measured with OpenAI's tokenizer, plain English prose runs 4.4 to 5.6 characters per token, source code about 2.7, and Chinese about 2.0. Use it for a rough sanity check, not for sizing a context window you cannot exceed.

OpenAI publishes its tokenizer's vocabulary, so the count can be computed in your browser and is exact. Anthropic and Google do not: their token counters are API endpoints that need a key. For those models this calculator uses each provider's own published characters-per-token guidance and labels the result an estimate rather than claiming a precision it cannot deliver.

No — the same tokenizer counts both. What differs is the price: providers charge more per output token than per input token. Use this calculator for the counts and a cost calculator for the rates.

CalculateYogi

The most comprehensive calculator web app. Free, fast, and accurate calculators for everyone.

Calculator Categories

  • Math
  • Finance
  • Health
  • Conversion
  • Date & Time
  • Statistics
  • Science
  • Engineering
  • Business
  • Everyday
  • Construction
  • Education
  • Technology
  • Food & Cooking
  • Sports
  • Climate & Environment
  • Agriculture & Ecology
  • Social Media
  • Other

Company

  • About
  • Contact
  • Contributors

Legal

  • Privacy Policy
  • Terms of Service
  • Editorial Policy

© 2026 CalculateYogi. All rights reserved.

Sitemap

Made with by the AppsYogi team