Token counter for tiktoken, OpenAI, Claude, and more.
API bills and context windows speak tokens, not pages. This is the live token counter for OpenAI-style tiktoken encodings, plus approximate Claude, ChatGPT, Gemini, GPT, and Anthropic length checks — switch modes in one paste box. Approximate modes stay labeled; your text never leaves the browser.
Exact mode: browser encoding o200k_base. Common model IDs that use this encoding: gpt-4o, gpt-4o-mini, gpt-4.1, gpt-4.1-mini, gpt-5, gpt-5-mini, o3, o3-mini, o4-mini. Newer IDs without a mapping do not rename this mode.
Good uses for this page
Check a prompt or completion before it hits a context limit.
Compare draft length while you edit, without uploading the text.
Get a planning estimate before you spend API budget.
Use OpenAI-style modes when you need tiktoken-class length; use Claude or Gemini modes when you only need a labeled estimate.
How this is counted
For OpenAI-style modes we use tiktoken-compatible encodings in the browser when available. For Claude- and Gemini-oriented modes we use documented approximation rules and mark the result as an estimate. The badge is intentional.
Characters are the raw string length. Words are a whitespace split only (spaces, tabs, newlines) — not linguistic word segmentation. Continuous Chinese with few spaces can show a low word count while characters stay high; that is expected. Chat formatting, system messages, and tool wrappers can still add tokens beyond this page, so treat the number as planning guidance, not a receipt. Read the full methodology →
Need a closer vendor match? Switch modes on this page. Exact billing always comes from the provider API or console.
Exact modes in the browser use only these encodings: o200k_base, cl100k_base. Model IDs that currently map to those encodings: gpt-4o, gpt-4o-mini, gpt-4.1, gpt-4.1-mini, gpt-4, gpt-4-turbo, gpt-3.5-turbo, gpt-5, gpt-5-mini, o3, o3-mini, o4-mini. Watched IDs still without a browser encoding (listed here only; exact mode names stay encoding-based, e.g. OpenAI (o200k), not marketing names like GPT-5.6): gpt-5.6, gpt-5.6-sol, gpt-5.6-terra, gpt-5.6-luna, gpt-5.4, gpt-5.4-mini.
Related tools
Questions
Estimates only. Not an official tokenizer from OpenAI, Anthropic, or Google. Verify with your provider before billing decisions.