# Tokens & Context Windows Cheat Sheet
_What counts, what it costs, and what falls out of the window_
Tokens are the unit of both billing and memory. Estimating them well is most of cost control and all of context management.
> Difficulty: intermediate  
> Version: 1.0  
> Updated: 2026-08-04  
> Categories: AI Models  
> Tags: Context Window, Openai, Tokens

Source: https://invitationbuddy.com/cheat-sheet/tokens-and-context-windows-cheat-sheet

---

## Estimating tokens
| Content | Rough tokens | Note |
| --- | --- | --- |
| English prose | ~1 token per 4 characters  About 0.75 tokens per word |
| Code | ~1 token per 3 characters  Punctuation and indentation are dense |
| JSON | Higher still  Braces, quotes and keys all cost |
| Non-Latin scripts | 2–3× more per character  Budget generously for CJK and Arabic |
| An A4 page of text | ~500–700 tokens  Useful for sizing document pipelines |

## What occupies the window
- [ ] The system prompt — every single turn — It is re-sent with each request, not remembered
- [ ] The full message history you choose to send — The API is stateless; you own the memory
- [ ] Tool and function definitions — Their JSON schemas are prompt text
- [ ] Tool results fed back in — Often the largest single contributor
- [ ] The reply being generated — Input and output share the window

## Truncation strategies
| Strategy | Keeps | Loses |
| --- | --- | --- |
| Sliding window | The last N turns  Anything agreed early on |
| Summarise-and-drop | A rolling summary plus recent turns  Detail, gradually |
| Pinned + recent | Explicitly marked turns, plus recent  Needs someone to choose the pins |
| Retrieval over history | Whatever matches the current turn  Continuity between turns |

## FAQs
**Does a bigger context window mean I can stop managing context?**
No. Cost scales with what you send, latency grows with it, and retrieval accuracy over a very long context is not uniform. A big window buys headroom, not a free pass.

**Why does my token count differ from my word count?**
Tokens are sub-word pieces. English prose runs about 0.75 tokens per word; code, JSON and non-Latin scripts run considerably higher because punctuation and rare characters split into more pieces.

---
_Generated from https://invitationbuddy.com/cheat-sheet/tokens-and-context-windows-cheat-sheet_
