Official OpenAI tokenizer · exact counts

OpenAI Token Counter

Count ChatGPT tokens exactly, not approximately. This OpenAI token calculator loads the same ChatGPT tokenizer the API uses — the real o200k_base vocabulary — so the number you see is the number you are billed for. Paste text or drop a file; everything runs in your browser, with no sign-up and no API key.

OpenAI token calculator

Count ChatGPT tokens.

Paste text, or switch to the file tab and drop a PDF, DOCX, TXT, Markdown, JSON or CSV file. Tokens, cost and context usage update as you type.

Drop files here or click to browse

Supports PDF, TXT, MD, JSON, CSV, XML — max 10MB

Count as an API request

Providers also bill the role and boundary tokens that wrap your text. Anthropic's own example — a short system prompt plus one message — costs 14 input tokens for 7 tokens of visible text.

Tokens
0
Words
0
Characters
0
Est. Cost (Input)
$0.0000
GPT-5.6 Terra Context Window0%
0 tokens used1M limit
Step by step

How to calculate tokens in ChatGPT

  1. 1

    Paste text or drop a file

    Type into the counter above, or drop a PDF, Word document, TXT, Markdown, JSON or CSV file onto it. Several files at once is fine — each gets its own count and the totals add up.

  2. 2

    Pick your OpenAI model

    Every model in the picker is billed differently, so the model decides the price rather than the count. GPT-5.6 Terra is preselected; the whole OpenAI line-up plus Claude, Gemini, Grok and DeepSeek are in the same list.

  3. 3

    The real tokenizer runs on your device

    Your text is encoded with OpenAI’s published BPE vocabulary in the browser tab — the same algorithm tiktoken runs server-side. No text is transmitted, logged or stored.

  4. 4

    Read the count, the cost and the context fit

    Tokens, words, characters and input cost, plus how much of the model’s context window your text would occupy before the reply is even generated.

How the tokenizer works

The three OpenAI tokenizers, and which models use them

OpenAI does not have one tokenizer — it has a small registry of byte-pair-encoding vocabularies, and a model’s token count depends on which one it was trained with. This is why the same sentence costs a different number of tokens on GPT-4o than it did on GPT-3.5.

o200k_base

Current generation

Roughly 200,000 merges, and the encoding behind every current OpenAI model — the GPT-5 family, GPT-4.1 and GPT-4o included. Its larger vocabulary compresses non-English text far better than its predecessor: Hindi, Chinese and Japanese cost roughly half the tokens they did under cl100k_base. The newest registry entry, o200k_harmony, reuses these exact ranks and only adds control tokens, so plain-text counts are identical.

cl100k_base

GPT-4 and GPT-3.5 Turbo

About 100,000 merges. It was the encoding for the original GPT-4, GPT-3.5 Turbo and the text-embedding-3 models, and it is still what a lot of production code assumes. English prose lands within a few percent of o200k_base, but code, JSON and any non-Latin script come out measurably heavier.

p50k_base

Legacy completion models

The GPT-3 era — text-davinci-003, Codex and the original embeddings. About 50,000 merges, and a genuinely worse fit for anything modern. It only matters now if you are reading old cost estimates and wondering why they do not reproduce.

A token is never a fixed number of characters. Common English words are usually one token, rarer ones split into several — "tokenization" becomes "token" + "ization" — and a leading space is part of the token that follows it.

OpenAI token pricing

What an OpenAI token costs, model by model

Input and output are metered separately, and output always costs several times more. Every rate here is per 1,000,000 tokens, which is how OpenAI publishes them.

OpenAI input and output token pricing per model, including cost per 1,000 input tokens, tokens per US dollar, and context window
ModelInput / 1MOutput / 1M1,000 inputTokens per $1Context
GPT-5.6 Sol$4.00$20.00$0.00400250,0001M
GPT-5.6 Terra$2.00$12.00$0.00200500,0001M
GPT-5.6 Luna$0.200$1.20$0.000205,000,0001M
GPT-5.5$5.00$30.00$0.00500200,0001M
GPT-5.4$2.50$15.00$0.00250400,0001M
GPT-5.4 mini$0.750$4.50$0.000751,333,333400K
GPT-5.4 nano$0.200$1.25$0.000205,000,000400K
GPT-5.1$1.25$10.00$0.00125800,000400K
GPT-4.1$2.00$8.00$0.00200500,0001M
GPT-4o$2.50$10.00$0.00250400,000128K
GPT-4o Mini$0.150$0.600$0.000156,666,667128K

Tokens, words and pages side by side

Approximate word count, page count and GPT-5.6 Terra input cost for common token amounts
Tokens≈ Words≈ PagesGPT-5.6 Terra input
1,0007501.5$0.00200
10,0007,50015$0.020
100,00075,000150$0.200
128,00096,000192$0.256
1,000,000750,0001,500$2.00

Assumes English prose at roughly 0.75 words per token and 500 words per page. Code, JSON and non-Latin scripts run considerably denser — count them rather than estimating.

FAQ

Frequently asked questions

Tokens & counting

What is a token in ChatGPT?

A token is the unit ChatGPT actually reads and writes — a subword fragment from the model’s byte-pair-encoding vocabulary, not a character and not a word. Common English words are a single token; longer or rarer ones split into pieces, so "tokenization" is counted as "token" + "ization". Punctuation, line breaks and the space in front of a word all count too. The model never sees your letters: it sees a list of token IDs, which is why every limit and every price is quoted in tokens.

How much is 1 token ChatGPT?

Two different answers, because "how much" can mean length or money. In length, 1 token is about 4 characters of English text, or 0.75 of a word — so four tokens is roughly three words. In money, one input token on GPT-5.6 Terra costs $0.000002, which is why nobody prices a single token: OpenAI quotes $2.00 per 1,000,000 input tokens instead. Non-English text, code and JSON are all denser, so a token buys you fewer characters there.

How to calculate tokens in ChatGPT?

Run the text through the same tokenizer the model uses — anything else is a guess. Paste it into the counter at the top of this page and the real o200k_base vocabulary encodes it in your browser, so the figure is exact rather than estimated. In code, the equivalent is OpenAI’s tiktoken library: encode the string and take the length of the returned array. The back-of-envelope check is characters ÷ 4 for English prose, but do not use it for code, non-Latin scripts or anything with heavy punctuation, where it can be off by half.

How to get ChatGPT tokens?

For the API, tokens are not bought as a package — you add credit to an OpenAI platform account and each request draws down that balance at the model’s per-million rate, so "getting tokens" means topping up billing and generating an API key. A ChatGPT Plus, Pro or Team subscription is separate: it is a flat monthly fee for the chat product with usage limits, not a token allowance you can spend against the API. If you only want to know how many tokens something will cost before you send it, that needs no account at all — this page counts it locally.

Cost & scale

How many words is 1 million tokens in ChatGPT?

About 750,000 words of ordinary English prose, or roughly 1,500 pages — five or six full-length novels. That is the prose figure; the same 1,000,000 tokens holds far fewer "words" of source code or JSON, because punctuation and indentation are tokenized too. In money, 1,000,000 input tokens costs $2.00 on GPT-5.6 Terra and $0.200 on GPT-5.6 Luna.

What is 1 million tokens in AI?

It is the industry's standard billing and context unit. As a quantity of text it is about 750,000 words or 1,500 pages. As a price it is the number every provider quotes against: $2.00 per million input tokens on GPT-5.6 Terra, $5.00 on GPT-5.5. As a context window it is now a real ceiling rather than a theoretical one — GPT-5.6 Terra accepts about 1,050,000 tokens in a single request, so a million-token document genuinely fits.

How many words are 1000 tokens?

About 750 words of English prose — a page and a half, or a long email. Turned around, 1,000 words of English costs roughly 1,333 tokens. The ratio holds well for ordinary writing and badly for everything else: a thousand tokens of minified JSON might carry only a couple of hundred recognisable words, and a thousand tokens of Hindi or Japanese covers noticeably less text than a thousand tokens of English.

How many tokens is $1?

One dollar of input buys about 500,000 tokens on GPT-5.6 Terra, 5,000,000 on GPT-5.6 Luna, 6,666,667 on GPT-4o Mini and 200,000 on GPT-5.5. Divide 1,000,000 by the model’s per-million input rate to get the figure for any row in the table above. Output is the expensive direction — the same dollar buys only 83,333 output tokens on GPT-5.6 Terra.

How much do 1000 tokens cost?

1,000 input tokens costs $0.00200 on GPT-5.6 Terra, $0.00020 on GPT-5.6 Luna, $0.00250 on GPT-4o and $0.00500 on GPT-5.5. OpenAI publishes per-million rates, so divide the headline number by 1,000 to get the per-1,000 figure. If you reuse the same prompt prefix across requests, check the cached input rate as well — on GPT-5.6 Terra it is $0.200 per million, a tenth of the standard rate.

How much does a GPT 4 token cost?

It depends which GPT-4 model. GPT-4o is $2.50 per million input tokens and $10.00 per million output; GPT-4o Mini is $0.150 and $0.600; GPT-4.1 is $2.00 and $8.00 with a context window of about 1,047,576 tokens. Per single token that works out to $0.0000025 of input on GPT-4o. Worth comparing before you commit: GPT-5.6 Terra is a newer model at $2.00 per million input — cheaper than GPT-4o — so staying on the GPT-4 generation is now usually a compatibility decision rather than a cost saving.

Keep going

The same tokenizer, pointed at different questions — the full ChatGPT model line-up, whole documents instead of pasted text, or a side-by-side price comparison across every provider.