Token chunks
Exact decoded token chunks are shown for OpenAI modes.
Paste a prompt, document, JSON payload, or code snippet to estimate token count before sending it to an LLM. Tokenization can vary by provider and model, so StackLens separates exact OpenAI tokenizer modes from estimated modes.
Exact decoded token chunks are shown for OpenAI modes.
Paste the prompt or payload you plan to send, choose the closest tokenizer mode, then compare token count, input cost, and context-window usage before you test in production.
Providers split text differently. Whitespace, CJK text, emoji, code blocks, JSON, and tool-call formatting can all change the final count.
Input cost scales with pasted-token volume and request count. Output cost depends on generated output length, so this page does not infer it from pasted input.
OpenAI GPT-4o / GPT-4o mini uses o200k_base, and OpenAI GPT-4 / GPT-3.5 legacy uses cl100k_base. Claude, Gemini, and DeepSeek are estimates because this static site does not call official token-count APIs.
Estimates are useful for planning. Exact billing may differ because providers tokenize text differently and APIs may add system, message, tool-call, or formatting tokens.
js-tiktoken local tokenizer libraryHigh confidenceChecked 2026-07-11
OpenAI tokenizer modes are counted locally in the browser with o200k_base or cl100k_base.
Claude, Gemini, and DeepSeek estimated modesPlanning estimateChecked 2026-07-11
Estimated modes do not call official provider token-count APIs and should not be used as billing proof.
StackLens source-tracked pricing dataVaries by providerChecked 2026-07-11
Input cost estimates use src/data/models.json and should be verified against official provider pricing pages.
OpenAI modes use exact OpenAI-style tokenization when the local tokenizer library is available. Claude, Gemini, and DeepSeek are estimated on this static page.
Different providers use different tokenizers. Code, JSON, Chinese text, emoji, whitespace, and mixed-language prompts can split differently.
No. The token counter processes pasted text in your browser.
Yes for planning. Input cost can be estimated from token count and source-tracked pricing, but final billing may include system, message, tool-call, output, and provider-specific tokens.
The static page does not call official provider token-count APIs. Use official provider APIs or usage logs for billing-critical decisions.