Tokens are not words: roughly 1,000 tokens equals 750 words in English. That ratio lets you estimate a prompt’s size before sending it, which matters because the context window counts tokens, not words, and a prompt longer than the window is cut before the model ever reads it. Estimate first, then decide whether to send, shorten or split the prompt.
Prerequisites
- The prompt text, or the document you plan to send.
- The context window size of your model and runtime, in tokens.
- A word counter, or a tokenizer if you have one.
Steps
Step 1: Count the words
Count the words in the prompt and in any document attached to it. Count the system prompt too; it is part of the context.
Step 2: Convert to tokens
Convert words to tokens at roughly 4 tokens for every 3 words: divide the word count by 750 and multiply by 1000. A 3,000-word document is about 4,000 tokens. This is an estimate; exact counts need the model’s tokenizer.
Step 3: Compare with the window
Add the prompt tokens, the document tokens and the room you need for the reply, and compare the total with the context window. If the total is over the window, shorten or split the prompt before sending it.
Worked example: Harbor Light library annual report question
The fictional Harbor Light library wants to ask a question about its annual report. The report is 3,000 words and the system prompt is 400 words.
| Part | Words | Estimated tokens | Running total |
|---|---|---|---|
| Annual report | 3000 | 4000 | 4000 |
| System prompt | 400 | 533 | 4533 |
| Question | 75 | 100 | 4633 |
| Room for the reply | 800 | 5433 |
The prompt plus the report plus room for the reply comes to about 5,433 tokens, which fits an 8,192-token window with about 2,759 tokens to spare.
Expected result. You have an estimated token total for the whole request, compared with the context window, before anything is sent. UNTESTED: this guide was not run against a live model or API. The worked example below is fictional practice material, and its result is the expected result, not a measured one.
Limits
- The 750-words-per-1000-tokens ratio is for English prose; code, tables and other languages differ.
- An estimate is not a count; for a prompt near the limit, count with the real tokenizer.
- This guide does not cover what to do when the prompt does not fit; that is a separate guide.
