LLM Token Counter — tiktoken, Context & Cost

Free browser-side LLM token counter: tiktoken-compatible BPE for OpenAI-style models, proxy encodings or heuristics for other providers, words and character stats, context-window usage with output reserve, and indicative $/M input/cached/output from a bundled reference table with official pricing links—no prompt upload.

LLM token counter & prompt budget

This tool estimates how many tokens a prompt consumes for the model you select, together with word counts and character statistics. Commercial APIs meter input and output in tokens and cap prompts by a context window, so a tokenizer-grounded preview helps you plan retrieval chunks, few-shot examples, tool definitions, and system prompts before you spend quota or hit length errors.

Pick a provider filter and a model row from the catalog. When the row maps to a tiktoken model name, counting uses CoreBPE in WebAssembly—the same family of encodings as the tiktoken library for that name. Other catalog rows may fall back to a documented base encoding (proxy BPE) or to a coarse characters-per-token heuristic; the results card states which path ran.

Below the interactive area, a separate sortable table lists indicative U.S.-style list prices per million tokens (input, optional cached input, output), published context limits, and links to official pricing pages. That table never inspects your paste; it is a static reference snapshot bundled with the app.

Workbench: prompt area, model options, and multiple outputs

The main tool area is split into two setting panels—Prompt input (single vs. split paste, and whether total characters include newlines) and Model & options (reference catalog model or custom context and $/M rates, output reserve, Add Output, and Jump to reference). Your prompt lives in the Prompt text or Prompt sections box below those panels; Clear prompt in that box header clears only the pasted content, using the same compact control style as Remove on each result card.

Add Output snapshots the current model options into another result block so you can compare the same prompt under different providers, models, or custom rates side by side. You can keep up to 5 comparison blocks; if you reach that limit, the tool will not add another and will tell you to remove a block first. Each block has its own Reference vs. Custom source toggle, metrics, Copy summary, and Remove.

Jump to reference scrolls this page to the sortable model pricing table. The app may persist UI preferences—including filters, sort order, and your list of output blocks and their per-block settings—in localStorage; it does not store your prompt body there.

Tokenization: BPE, tiktoken, proxy encodings, and heuristics

Large language models do not read characters directly; a tokenizer maps Unicode text to a sequence of integer tokens via a vocabulary and merge rules (commonly byte-level BPE variants). Two strings that look similar in an editor can tokenize differently after normalization, which is why byte length or word count alone is a poor proxy for invoiceable tokens.

For OpenAI-compatible names, this build resolves the same model keys that tiktoken exposes: the counter runs ordinary encoding (no special chat template injection) so your paste is measured as raw prompt bytes after UTF-8, matching typical developer expectations for pasted prompts.

When the catalog cannot load a named BPE, it may still load a fallback tokenizer such as cl100k_base or o200k_base; the UI labels that as proxy BPE because the provider might ship a custom vocabulary even if pricing is grouped with a public tokenizer family. The last resort is a heuristic that divides character count by four and rounds up—use it only for rough magnitude.

Context window, output reserve, and usage percentage

The context window is the maximum number of tokens the model accepts in a single forward pass for the catalog entry (sometimes reported in “tokens” mixing input and tool overhead on the provider side). The calculator compares your counted prompt tokens plus an integer reserve you type—typically headroom reserved for model output such as max_tokens—to that published window and shows a usage percentage.

If the reserve is zero, the percentage reflects prompt-only pressure on the window. If you set the reserve near your expected completion length, the percentage approximates total conversational pressure including a generation budget. Percentages are undefined when the catalog context is zero or missing.

Indicative cost lines from reference $/M rates

The results grid multiplies your token count by the catalog input price per million tokens for an estimated input charge, optionally multiplies the same count by the cached-input rate to show a hypothetical cached scenario, and multiplies the reserve by the output rate for a completion estimate. Missing rates show an em dash. These are back-of-the-envelope figures for planning; real invoices add discounts, tax, regional pricing, and token classifications you cannot see from paste alone.

Privacy and where computation runs

Token counting executes entirely in your browser via WebAssembly. The tool persists only UI preferences (selected model, filters, sort order) in localStorage—never your prompt body. In normal use, nothing in this client sends your pasted text to CompuTools servers for tokenization; treat network policy the same as any static site you load from the open web.

Accuracy, billing, and catalog freshness

  • Provider dashboards may attach hidden system instructions, reformat JSON, prepend retrieval blocks, or count tool calls differently, so billed tokens can diverge from a raw paste.
  • Cached-input discounts apply only to repeated prefixes the provider recognizes; the cached line in the UI assumes the optimistic all-cached case when a rate exists.
  • Reference data as of: 2026-04-08. Sourced from LiteLLM model_prices_and_context_window.json (see scripts/update_llm_models.py). Reference $/M; verify on provider dashboards.

Model pricing reference

Indicative $/M (input, cached input, output) and links to external pricing pages, from bundled reference data—not a product catalog. Sort columns or filter by provider / substring—no estimates from your prompt text.

Reference data as of: 2026-04-08

Click column headers to sort; toggle again to reverse. Figures are for reference only (not billing quotes).

Ref.
1024-x-1024/dall-e-2OpenAIUnknown
1024-x-1024/gpt-image-1.5OpenAIUnknown
1024-x-1024/gpt-image-1.5-2025-12-16OpenAIUnknown
1024-x-1536/gpt-image-1.5OpenAIUnknown
1024-x-1536/gpt-image-1.5-2025-12-16OpenAIUnknown
1536-x-1024/gpt-image-1.5OpenAIUnknown
1536-x-1024/gpt-image-1.5-2025-12-16OpenAIUnknown
256-x-256/dall-e-2OpenAIUnknown
512-x-512/dall-e-2OpenAIUnknown
chatgpt-4o-latestOpenAI128K$5.0000$15.0000
chatgpt-image-latestOpenAIUnknown$5.0000$1.2500
claude-3-7-sonnet-20250219Anthropic200K$3.0000$0.3000$15.0000
claude-3-haiku-20240307Anthropic200K$0.2500$0.0300$1.2500
claude-3-opus-20240229Anthropic200K$15.0000$1.5000$75.0000
claude-4-opus-20250514Anthropic200K$15.0000$1.5000$75.0000
claude-4-sonnet-20250514Anthropic1M$3.0000$0.3000$15.0000
claude-haiku-4-5Anthropic200K$1.0000$0.1000$5.0000
claude-haiku-4-5-20251001Anthropic200K$1.0000$0.1000$5.0000
claude-opus-4-1Anthropic200K$15.0000$1.5000$75.0000
claude-opus-4-1-20250805Anthropic200K$15.0000$1.5000$75.0000
claude-opus-4-20250514Anthropic200K$15.0000$1.5000$75.0000
claude-opus-4-5Anthropic200K$5.0000$0.5000$25.0000
claude-opus-4-5-20251101Anthropic200K$5.0000$0.5000$25.0000
claude-opus-4-6Anthropic1M$5.0000$0.5000$25.0000
claude-opus-4-6-20260205Anthropic1M$5.0000$0.5000$25.0000
claude-sonnet-4-20250514Anthropic1M$3.0000$0.3000$15.0000
claude-sonnet-4-5Anthropic200K$3.0000$0.3000$15.0000
claude-sonnet-4-5-20250929Anthropic200K$3.0000$0.3000$15.0000
claude-sonnet-4-6Anthropic1M$3.0000$0.3000$15.0000
codex-mini-latestOpenAI200K$1.5000$0.3800$6.0000
cohere/embed-v4.0Cohere128K$0.1200$0.0000
commandCohere4K$1.0000$2.0000
command-nightlyCohere4K$1.0000$2.0000
dall-e-2OpenAIUnknown
dall-e-3OpenAIUnknown
deepseek-chatDeepSeek131K$0.2800$0.0300$0.4200
deepseek-reasonerDeepSeek131K$0.2800$0.0300$0.4200
deepseek/deepseek-chatDeepSeek131K$0.2800$0.0300$0.4200
deepseek/deepseek-coderDeepSeek128K$0.1400$0.2800
deepseek/deepseek-r1DeepSeek65K$0.5500$2.1900
deepseek/deepseek-reasonerDeepSeek131K$0.2800$0.0300$0.4200
deepseek/deepseek-v3DeepSeek65K$0.2700$0.0700$1.1000
deepseek/deepseek-v3.2DeepSeek163K$0.2800$0.4000
embed-english-light-v2.0Cohere1K$0.1000$0.0000
embed-english-light-v3.0Cohere1K$0.1000$0.0000
embed-english-v2.0Cohere4K$0.1000$0.0000
embed-english-v3.0Cohere1K$0.1000$0.0000
embed-multilingual-light-v3.0Cohere1K$100.0000$0.0000
embed-multilingual-v2.0Cohere768$0.1000$0.0000
embed-multilingual-v3.0Cohere1K$0.1000$0.0000
ft:gpt-3.5-turboOpenAI16K$3.0000$6.0000
ft:gpt-3.5-turbo-0125OpenAI16K$3.0000$6.0000
ft:gpt-3.5-turbo-0613OpenAI4K$3.0000$6.0000
ft:gpt-3.5-turbo-1106OpenAI16K$3.0000$6.0000
ft:gpt-4-0613OpenAI8K$30.0000$60.0000
ft:gpt-4.1-2025-04-14OpenAI1M$3.0000$0.7500$12.0000
ft:gpt-4.1-mini-2025-04-14OpenAI1M$0.8000$0.2000$3.2000
ft:gpt-4.1-nano-2025-04-14OpenAI1M$0.2000$0.0500$0.8000
ft:gpt-4o-2024-08-06OpenAI128K$3.7500$1.8800$15.0000
ft:gpt-4o-2024-11-20OpenAI128K$3.7500$15.0000
ft:gpt-4o-mini-2024-07-18OpenAI128K$0.3000$0.1500$1.2000
ft:o4-mini-2025-04-16OpenAI200K$4.0000$1.0000$16.0000
gemini-2.0-flash-exp-image-generationGoogle32K$0.0000$0.0000
gemini-2.5-flash-native-audio-latestGoogle1M$0.3000$2.5000
gemini-2.5-flash-native-audio-preview-09-2025Google1M$0.3000$2.5000
gemini-2.5-flash-native-audio-preview-12-2025Google1M$0.3000$2.5000
gemini-2.5-flash-preview-ttsGoogleUnknown$0.3000$2.5000
gemini-3.1-flash-live-previewGoogle131K$0.7500$4.5000
gemini-exp-1206Google1M$0.3000$0.0300$2.5000
gemini-flash-latestGoogle1M$0.3000$0.0300$2.5000
gemini-flash-lite-latestGoogle1M$0.1000$0.0100$0.4000
gemini-pro-latestGoogle1M$1.2500$0.1200$10.0000
gemini/deep-research-pro-preview-12-2025Google65K$2.0000$12.0000
gemini/gemini-1.5-flashGoogle8K$0.0700$0.0000
gemini/gemini-2.0-flashGoogle1M$0.1000$0.0200$0.4000
gemini/gemini-2.0-flash-001Google1M$0.1000$0.0200$0.4000
gemini/gemini-2.0-flash-exp-image-generationGoogle32K$0.0000$0.0000
gemini/gemini-2.0-flash-liteGoogle1M$0.0700$0.0200$0.3000
gemini/gemini-2.0-flash-lite-001Google1M$0.0700$0.0200$0.3000
gemini/gemini-2.5-computer-use-preview-10-2025Google128K$1.2500$10.0000
gemini/gemini-2.5-flashGoogle1M$0.3000$0.0300$2.5000
gemini/gemini-2.5-flash-imageGoogle32K$0.3000$0.0300$2.5000
gemini/gemini-2.5-flash-liteGoogle1M$0.1000$0.0100$0.4000
gemini/gemini-2.5-flash-lite-preview-06-17Google1M$0.1000$0.0200$0.4000
gemini/gemini-2.5-flash-lite-preview-09-2025Google1M$0.1000$0.0100$0.4000
gemini/gemini-2.5-flash-native-audio-latestGoogle1M$0.3000$2.5000
gemini/gemini-2.5-flash-native-audio-preview-09-2025Google1M$0.3000$2.5000
gemini/gemini-2.5-flash-native-audio-preview-12-2025Google1M$0.3000$2.5000
gemini/gemini-2.5-flash-preview-09-2025Google1M$0.3000$0.0700$2.5000
gemini/gemini-2.5-flash-preview-ttsGoogleUnknown$0.3000$2.5000
gemini/gemini-2.5-proGoogle1M$1.2500$0.1200$10.0000
gemini/gemini-2.5-pro-preview-ttsGoogle1M$1.2500$0.1200$10.0000
gemini/gemini-3-flash-previewGoogle1M$0.5000$0.0500$3.0000
gemini/gemini-3-pro-image-previewGoogle65K$2.0000$12.0000
gemini/gemini-3-pro-previewGoogle1M$2.0000$0.2000$12.0000
gemini/gemini-3.1-flash-image-previewGoogle65K$0.2500$1.5000
gemini/gemini-3.1-flash-lite-previewGoogle1M$0.2500$0.0200$1.5000
gemini/gemini-3.1-flash-live-previewGoogle131K$0.7500$4.5000
gemini/gemini-3.1-pro-previewGoogle1M$2.0000$0.2000$12.0000
gemini/gemini-3.1-pro-preview-customtoolsGoogle1M$2.0000$0.2000$12.0000
gemini/gemini-embedding-001Google2K$0.1500$0.0000
gemini/gemini-embedding-2-previewGoogle8K$0.2000$0.0000
gemini/gemini-exp-1114Google1M$0.0000$0.0000
gemini/gemini-exp-1206Google2M$0.0000$0.0000
gemini/gemini-flash-latestGoogle1M$0.3000$0.0700$2.5000
gemini/gemini-flash-lite-latestGoogle1M$0.1000$0.0200$0.4000
gemini/gemini-gemma-2-27b-itGoogle8K$0.3500$1.0500
gemini/gemini-gemma-2-9b-itGoogle8K$0.3500$1.0500
gemini/gemini-live-2.5-flash-preview-native-audio-09-2025Google1M$0.3000$0.0700$2.0000
gemini/gemini-pro-latestGoogle1M$1.2500$0.1200$10.0000
gemini/gemini-robotics-er-1.5-previewGoogle1M$0.3000$0.0000$2.5000
gemini/gemma-3-27b-itGoogle131K$0.0000$0.0000
gemini/imagen-3.0-fast-generate-001GoogleUnknown
gemini/imagen-3.0-generate-001GoogleUnknown
gemini/imagen-3.0-generate-002GoogleUnknown
gemini/imagen-4.0-fast-generate-001GoogleUnknown
gemini/imagen-4.0-generate-001GoogleUnknown
gemini/imagen-4.0-ultra-generate-001GoogleUnknown
gemini/learnlm-1.5-pro-experimentalGoogle32K$0.0000$0.0000
gemini/lyria-3-clip-previewGoogle131K$0.0000$0.0000
gemini/lyria-3-pro-previewGoogle131K$0.0000$0.0000
gemini/veo-2.0-generate-001Google1K
gemini/veo-3.1-fast-generate-001Google1K
gemini/veo-3.1-fast-generate-previewGoogle1K
gemini/veo-3.1-generate-001Google1K
gemini/veo-3.1-generate-previewGoogle1K
gpt-3.5-turboOpenAI16K$0.5000$1.5000
gpt-3.5-turbo-0125OpenAI16K$0.5000$1.5000
gpt-3.5-turbo-1106OpenAI16K$1.0000$2.0000
gpt-3.5-turbo-16kOpenAI16K$3.0000$4.0000
gpt-4OpenAI8K$30.0000$60.0000
gpt-4-0125-previewOpenAI128K$10.0000$30.0000
gpt-4-0314OpenAI8K$30.0000$60.0000
gpt-4-0613OpenAI8K$30.0000$60.0000
gpt-4-1106-previewOpenAI128K$10.0000$30.0000
gpt-4-turboOpenAI128K$10.0000$30.0000
gpt-4-turbo-2024-04-09OpenAI128K$10.0000$30.0000
gpt-4-turbo-previewOpenAI128K$10.0000$30.0000
gpt-4.1OpenAI1M$2.0000$0.5000$8.0000
gpt-4.1-2025-04-14OpenAI1M$2.0000$0.5000$8.0000
gpt-4.1-miniOpenAI1M$0.4000$0.1000$1.6000
gpt-4.1-mini-2025-04-14OpenAI1M$0.4000$0.1000$1.6000
gpt-4.1-nanoOpenAI1M$0.1000$0.0200$0.4000
gpt-4.1-nano-2025-04-14OpenAI1M$0.1000$0.0200$0.4000
gpt-4oOpenAI128K$2.5000$1.2500$10.0000
gpt-4o-2024-05-13OpenAI128K$5.0000$15.0000
gpt-4o-2024-08-06OpenAI128K$2.5000$1.2500$10.0000
gpt-4o-2024-11-20OpenAI128K$2.5000$1.2500$10.0000
gpt-4o-audio-previewOpenAI128K$2.5000$10.0000
gpt-4o-audio-preview-2024-12-17OpenAI128K$2.5000$10.0000
gpt-4o-audio-preview-2025-06-03OpenAI128K$2.5000$10.0000
gpt-4o-miniOpenAI128K$0.1500$0.0700$0.6000
gpt-4o-mini-2024-07-18OpenAI128K$0.1500$0.0700$0.6000
gpt-4o-mini-audio-previewOpenAI128K$0.1500$0.6000
gpt-4o-mini-audio-preview-2024-12-17OpenAI128K$0.1500$0.6000
gpt-4o-mini-realtime-previewOpenAI128K$0.6000$0.3000$2.4000
gpt-4o-mini-realtime-preview-2024-12-17OpenAI128K$0.6000$0.3000$2.4000
gpt-4o-mini-search-previewOpenAI128K$0.1500$0.0700$0.6000
gpt-4o-mini-search-preview-2025-03-11OpenAI128K$0.1500$0.0700$0.6000
gpt-4o-mini-transcribeOpenAI16K$1.2500$5.0000
gpt-4o-mini-transcribe-2025-03-20OpenAI16K$1.2500$5.0000
gpt-4o-mini-transcribe-2025-12-15OpenAI16K$1.2500$5.0000
gpt-4o-mini-ttsOpenAIUnknown$2.5000$10.0000
gpt-4o-mini-tts-2025-03-20OpenAIUnknown$2.5000$10.0000
gpt-4o-mini-tts-2025-12-15OpenAIUnknown$2.5000$10.0000
gpt-4o-realtime-previewOpenAI128K$5.0000$2.5000$20.0000
gpt-4o-realtime-preview-2024-12-17OpenAI128K$5.0000$2.5000$20.0000
gpt-4o-realtime-preview-2025-06-03OpenAI128K$5.0000$2.5000$20.0000
gpt-4o-search-previewOpenAI128K$2.5000$1.2500$10.0000
gpt-4o-search-preview-2025-03-11OpenAI128K$2.5000$1.2500$10.0000
gpt-4o-transcribeOpenAI16K$2.5000$10.0000
gpt-4o-transcribe-diarizeOpenAI16K$2.5000$10.0000
gpt-5OpenAI272K$1.2500$0.1200$10.0000
gpt-5-2025-08-07OpenAI272K$1.2500$0.1200$10.0000
gpt-5-chatOpenAI128K$1.2500$0.1200$10.0000
gpt-5-chat-latestOpenAI128K$1.2500$0.1200$10.0000
gpt-5-codexOpenAI272K$1.2500$0.1200$10.0000
gpt-5-miniOpenAI272K$0.2500$0.0200$2.0000
gpt-5-mini-2025-08-07OpenAI272K$0.2500$0.0200$2.0000
gpt-5-nanoOpenAI272K$0.0500$0.0100$0.4000
gpt-5-nano-2025-08-07OpenAI272K$0.0500$0.0100$0.4000
gpt-5-proOpenAI128K$15.0000$120.0000
gpt-5-pro-2025-10-06OpenAI128K$15.0000$120.0000
gpt-5-search-apiOpenAI272K$1.2500$0.1200$10.0000
gpt-5-search-api-2025-10-14OpenAI272K$1.2500$0.1200$10.0000
gpt-5.1OpenAI272K$1.2500$0.1200$10.0000
gpt-5.1-2025-11-13OpenAI272K$1.2500$0.1200$10.0000
gpt-5.1-chat-latestOpenAI128K$1.2500$0.1200$10.0000
gpt-5.1-codexOpenAI272K$1.2500$0.1200$10.0000
gpt-5.1-codex-maxOpenAI272K$1.2500$0.1200$10.0000
gpt-5.1-codex-miniOpenAI272K$0.2500$0.0200$2.0000
gpt-5.2OpenAI272K$1.7500$0.1700$14.0000
gpt-5.2-2025-12-11OpenAI272K$1.7500$0.1700$14.0000
gpt-5.2-chat-latestOpenAI128K$1.7500$0.1700$14.0000
gpt-5.2-codexOpenAI272K$1.7500$0.1700$14.0000
gpt-5.2-proOpenAI272K$21.0000$168.0000
gpt-5.2-pro-2025-12-11OpenAI272K$21.0000$168.0000
gpt-5.3-chat-latestOpenAI128K$1.7500$0.1700$14.0000
gpt-5.3-codexOpenAI272K$1.7500$0.1700$14.0000
gpt-5.4OpenAI1M$2.5000$0.2500$15.0000
gpt-5.4-2026-03-05OpenAI1M$2.5000$0.2500$15.0000
gpt-5.4-miniOpenAI272K$0.7500$0.0700$4.5000
gpt-5.4-nanoOpenAI272K$0.2000$0.0200$1.2500
gpt-5.4-proOpenAI1M$30.0000$3.0000$180.0000
gpt-5.4-pro-2026-03-05OpenAI1M$30.0000$3.0000$180.0000
gpt-audioOpenAI128K$2.5000$10.0000
gpt-audio-1.5OpenAI128K$2.5000$10.0000
gpt-audio-2025-08-28OpenAI128K$2.5000$10.0000
gpt-audio-miniOpenAI128K$0.6000$2.4000
gpt-audio-mini-2025-10-06OpenAI128K$0.6000$2.4000
gpt-audio-mini-2025-12-15OpenAI128K$0.6000$2.4000
gpt-image-1OpenAIUnknown$5.0000$1.2500
gpt-image-1-miniOpenAIUnknown$2.0000$0.2000
gpt-image-1.5OpenAIUnknown$5.0000$1.2500$10.0000
gpt-image-1.5-2025-12-16OpenAIUnknown$5.0000$1.2500$10.0000
gpt-realtimeOpenAI32K$4.0000$0.4000$16.0000
gpt-realtime-1.5OpenAI32K$4.0000$0.4000$16.0000
gpt-realtime-2025-08-28OpenAI32K$4.0000$0.4000$16.0000
gpt-realtime-miniOpenAI128K$0.6000$2.4000
gpt-realtime-mini-2025-10-06OpenAI128K$0.6000$0.0600$2.4000
gpt-realtime-mini-2025-12-15OpenAI128K$0.6000$0.0600$2.4000
hd/1024-x-1024/dall-e-3OpenAIUnknown
hd/1024-x-1792/dall-e-3OpenAIUnknown
hd/1792-x-1024/dall-e-3OpenAIUnknown
high/1024-x-1024/gpt-image-1OpenAIUnknown
high/1024-x-1024/gpt-image-1.5OpenAIUnknown
high/1024-x-1024/gpt-image-1.5-2025-12-16OpenAIUnknown
high/1024-x-1536/gpt-image-1OpenAIUnknown
high/1024-x-1536/gpt-image-1.5OpenAIUnknown
high/1024-x-1536/gpt-image-1.5-2025-12-16OpenAIUnknown
high/1536-x-1024/gpt-image-1OpenAIUnknown
high/1536-x-1024/gpt-image-1.5OpenAIUnknown
high/1536-x-1024/gpt-image-1.5-2025-12-16OpenAIUnknown
j2-lightAI21 Labs8K$3.0000$3.0000
j2-midAI21 Labs8K$10.0000$10.0000
j2-ultraAI21 Labs8K$15.0000$15.0000
jamba-1.5AI21 Labs256K$0.2000$0.4000
jamba-1.5-largeAI21 Labs256K$2.0000$8.0000
jamba-1.5-large@001AI21 Labs256K$2.0000$8.0000
jamba-1.5-miniAI21 Labs256K$0.2000$0.4000
jamba-1.5-mini@001AI21 Labs256K$0.2000$0.4000
jamba-large-1.6AI21 Labs256K$2.0000$8.0000
jamba-large-1.7AI21 Labs256K$2.0000$8.0000
jamba-mini-1.6AI21 Labs256K$0.2000$0.4000
jamba-mini-1.7AI21 Labs256K$0.2000$0.4000
low/1024-x-1024/gpt-image-1OpenAIUnknown
low/1024-x-1024/gpt-image-1-miniOpenAIUnknown
low/1024-x-1024/gpt-image-1.5OpenAIUnknown
low/1024-x-1024/gpt-image-1.5-2025-12-16OpenAIUnknown
low/1024-x-1536/gpt-image-1OpenAIUnknown
low/1024-x-1536/gpt-image-1-miniOpenAIUnknown
low/1024-x-1536/gpt-image-1.5OpenAIUnknown
low/1024-x-1536/gpt-image-1.5-2025-12-16OpenAIUnknown
low/1536-x-1024/gpt-image-1OpenAIUnknown
low/1536-x-1024/gpt-image-1-miniOpenAIUnknown
low/1536-x-1024/gpt-image-1.5OpenAIUnknown
low/1536-x-1024/gpt-image-1.5-2025-12-16OpenAIUnknown
medium/1024-x-1024/gpt-image-1OpenAIUnknown
medium/1024-x-1024/gpt-image-1-miniOpenAIUnknown
medium/1024-x-1024/gpt-image-1.5OpenAIUnknown
medium/1024-x-1024/gpt-image-1.5-2025-12-16OpenAIUnknown
medium/1024-x-1536/gpt-image-1OpenAIUnknown
medium/1024-x-1536/gpt-image-1-miniOpenAIUnknown
medium/1024-x-1536/gpt-image-1.5OpenAIUnknown
medium/1024-x-1536/gpt-image-1.5-2025-12-16OpenAIUnknown
medium/1536-x-1024/gpt-image-1OpenAIUnknown
medium/1536-x-1024/gpt-image-1-miniOpenAIUnknown
medium/1536-x-1024/gpt-image-1.5OpenAIUnknown
medium/1536-x-1024/gpt-image-1.5-2025-12-16OpenAIUnknown
mistral/codestral-2405Mistral AI32K$1.0000$3.0000
mistral/codestral-2508Mistral AI256K$0.3000$0.9000
mistral/codestral-embedMistral AI8K$0.1500
mistral/codestral-embed-2505Mistral AI8K$0.1500
mistral/codestral-latestMistral AI32K$1.0000$3.0000
mistral/codestral-mamba-latestMistral AI256K$0.2500$0.2500
mistral/devstral-2512Mistral AI256K$0.4000$2.0000
mistral/devstral-latestMistral AI256K$0.4000$2.0000
mistral/devstral-medium-2507Mistral AI128K$0.4000$2.0000
mistral/devstral-medium-latestMistral AI256K$0.4000$2.0000
mistral/devstral-small-2505Mistral AI128K$0.1000$0.3000
mistral/devstral-small-2507Mistral AI128K$0.1000$0.3000
mistral/devstral-small-latestMistral AI256K$0.1000$0.3000
mistral/labs-devstral-small-2512Mistral AI256K$0.1000$0.3000
mistral/magistral-medium-1-2-2509Mistral AI40K$2.0000$5.0000
mistral/magistral-medium-2506Mistral AI40K$2.0000$5.0000
mistral/magistral-medium-2509Mistral AI40K$2.0000$5.0000
mistral/magistral-medium-latestMistral AI40K$2.0000$5.0000
mistral/magistral-small-1-2-2509Mistral AI40K$0.5000$1.5000
mistral/magistral-small-2506Mistral AI40K$0.5000$1.5000
mistral/magistral-small-latestMistral AI40K$0.5000$1.5000
mistral/ministral-3-14b-2512Mistral AI262K$0.2000$0.2000
mistral/ministral-3-3b-2512Mistral AI131K$0.1000$0.1000
mistral/ministral-3-8b-2512Mistral AI262K$0.1500$0.1500
mistral/mistral-embedMistral AI8K$0.1000
mistral/mistral-large-2402Mistral AI32K$4.0000$12.0000
mistral/mistral-large-2407Mistral AI128K$3.0000$9.0000
mistral/mistral-large-2411Mistral AI128K$2.0000$6.0000
mistral/mistral-large-2512Mistral AI262K$0.5000$1.5000
mistral/mistral-large-3Mistral AI262K$0.5000$1.5000
mistral/mistral-large-latestMistral AI262K$0.5000$1.5000
mistral/mistral-mediumMistral AI32K$2.7000$8.1000
mistral/mistral-medium-2312Mistral AI32K$2.7000$8.1000
mistral/mistral-medium-2505Mistral AI131K$0.4000$2.0000
mistral/mistral-medium-3-1-2508Mistral AI131K$0.4000$2.0000
mistral/mistral-medium-latestMistral AI131K$0.4000$2.0000
mistral/mistral-ocr-2505-completionMistral AIUnknown
mistral/mistral-ocr-latestMistral AIUnknown
mistral/mistral-smallMistral AI32K$0.1000$0.3000
mistral/mistral-small-3-2-2506Mistral AI131K$0.0600$0.1800
mistral/mistral-small-latestMistral AI131K$0.0600$0.1800
mistral/mistral-tinyMistral AI32K$0.2500$0.2500
mistral/open-codestral-mambaMistral AI256K$0.2500$0.2500
mistral/open-mistral-7bMistral AI32K$0.2500$0.2500
mistral/open-mistral-nemoMistral AI128K$0.3000$0.3000
mistral/open-mistral-nemo-2407Mistral AI128K$0.3000$0.3000
mistral/open-mixtral-8x22bMistral AI65K$2.0000$6.0000
mistral/open-mixtral-8x7bMistral AI32K$0.7000$0.7000
mistral/pixtral-12b-2409Mistral AI128K$0.1500$0.1500
mistral/pixtral-large-2411Mistral AI128K$2.0000$6.0000
mistral/pixtral-large-latestMistral AI128K$2.0000$6.0000
moonshot/kimi-k2-0711-previewMoonshot AI131K$0.6000$0.1500$2.5000
moonshot/kimi-k2-0905-previewMoonshot AI262K$0.6000$0.1500$2.5000
moonshot/kimi-k2-thinkingMoonshot AI262K$0.6000$0.1500$2.5000
moonshot/kimi-k2-thinking-turboMoonshot AI262K$1.1500$0.1500$8.0000
moonshot/kimi-k2-turbo-previewMoonshot AI262K$1.1500$0.1500$8.0000
moonshot/kimi-k2.5Moonshot AI262K$0.6000$0.1000$3.0000
moonshot/kimi-latestMoonshot AI131K$2.0000$0.1500$5.0000
moonshot/kimi-latest-128kMoonshot AI131K$2.0000$0.1500$5.0000
moonshot/kimi-latest-32kMoonshot AI32K$1.0000$0.1500$3.0000
moonshot/kimi-latest-8kMoonshot AI8K$0.2000$0.1500$2.0000
moonshot/kimi-thinking-previewMoonshot AI131K$0.6000$0.1500$2.5000
moonshot/moonshot-v1-128kMoonshot AI131K$2.0000$5.0000
moonshot/moonshot-v1-128k-0430Moonshot AI131K$2.0000$5.0000
moonshot/moonshot-v1-128k-vision-previewMoonshot AI131K$2.0000$5.0000
moonshot/moonshot-v1-32kMoonshot AI32K$1.0000$3.0000
moonshot/moonshot-v1-32k-0430Moonshot AI32K$1.0000$3.0000
moonshot/moonshot-v1-32k-vision-previewMoonshot AI32K$1.0000$3.0000
moonshot/moonshot-v1-8kMoonshot AI8K$0.2000$2.0000
moonshot/moonshot-v1-8k-0430Moonshot AI8K$0.2000$2.0000
moonshot/moonshot-v1-8k-vision-previewMoonshot AI8K$0.2000$2.0000
moonshot/moonshot-v1-autoMoonshot AI131K$2.0000$5.0000
o1OpenAI200K$15.0000$7.5000$60.0000
o1-2024-12-17OpenAI200K$15.0000$7.5000$60.0000
o1-proOpenAI200K$150.0000$600.0000
o1-pro-2025-03-19OpenAI200K$150.0000$600.0000
o3OpenAI200K$2.0000$0.5000$8.0000
o3-2025-04-16OpenAI200K$2.0000$0.5000$8.0000
o3-deep-researchOpenAI200K$10.0000$2.5000$40.0000
o3-deep-research-2025-06-26OpenAI200K$10.0000$2.5000$40.0000
o3-miniOpenAI200K$1.1000$0.5500$4.4000
o3-mini-2025-01-31OpenAI200K$1.1000$0.5500$4.4000
o3-proOpenAI200K$20.0000$80.0000
o3-pro-2025-06-10OpenAI200K$20.0000$80.0000
o4-miniOpenAI200K$1.1000$0.2800$4.4000
o4-mini-2025-04-16OpenAI200K$1.1000$0.2800$4.4000
o4-mini-deep-researchOpenAI200K$2.0000$0.5000$8.0000
o4-mini-deep-research-2025-06-26OpenAI200K$2.0000$0.5000$8.0000
omni-moderation-2024-09-26OpenAI32K$0.0000$0.0000
omni-moderation-latestOpenAI32K$0.0000$0.0000
openai/containerOpenAIUnknown
openai/sora-2OpenAIUnknown
openai/sora-2-proOpenAIUnknown
openai/sora-2-pro-high-resOpenAIUnknown
rerank-english-v2.0Cohere4K$0.0000$0.0000
rerank-english-v3.0Cohere4K$0.0000$0.0000
rerank-multilingual-v2.0Cohere4K$0.0000$0.0000
rerank-multilingual-v3.0Cohere4K$0.0000$0.0000
rerank-v3.5Cohere4K$0.0000$0.0000
sora-2OpenAIUnknown
sora-2-proOpenAIUnknown
sora-2-pro-high-resOpenAIUnknown
standard/1024-x-1024/dall-e-3OpenAIUnknown
standard/1024-x-1024/gpt-image-1.5OpenAIUnknown
standard/1024-x-1024/gpt-image-1.5-2025-12-16OpenAIUnknown
standard/1024-x-1536/gpt-image-1.5OpenAIUnknown
standard/1024-x-1536/gpt-image-1.5-2025-12-16OpenAIUnknown
standard/1024-x-1792/dall-e-3OpenAIUnknown
standard/1536-x-1024/gpt-image-1.5OpenAIUnknown
standard/1536-x-1024/gpt-image-1.5-2025-12-16OpenAIUnknown
standard/1792-x-1024/dall-e-3OpenAIUnknown
text-embedding-3-largeOpenAI8K$0.1300$0.0000
text-embedding-3-smallOpenAI8K$0.0200$0.0000
text-embedding-ada-002OpenAI8K$0.1000$0.0000
text-embedding-ada-002-v2OpenAI8K$0.1000$0.0000
text-moderation-007OpenAI32K$0.0000$0.0000
text-moderation-latestOpenAI32K$0.0000$0.0000
text-moderation-stableOpenAI32K$0.0000$0.0000
tts-1OpenAIUnknown
tts-1-1106OpenAIUnknown
tts-1-hdOpenAIUnknown
tts-1-hd-1106OpenAIUnknown
whisper-1OpenAIUnknown

Frequently Asked Questions

What is an LLM token, and why does token count matter for API pricing and context limits?

An LLM token is a unit of text after the model tokenizer splits input into subwords or symbols. APIs bill and enforce limits in tokens rather than raw characters, and each model tokenizer can split the same Unicode differently. This tool counts tokens locally so you can estimate prompt size, remaining context window, and rough cost before sending a request.

How does this token counter compare to provider usage dashboards?

When the UI shows tiktoken-compatible counting, the WASM build uses the same CoreBPE encodings as tiktoken for the named model. Official dashboards may still differ slightly due to hidden system prefixes, formatting, or tool calls. Rows labeled proxy BPE or heuristic are approximations; use the provider for authoritative billing.

What do tiktoken, proxy BPE, and heuristic mean in the token note?

Tiktoken means the count uses CoreBPE for the catalog model name. Proxy BPE loads a documented base vocabulary such as cl100k_base or o200k_base when the catalog maps a provider model to that encoding. Heuristic divides character count by four and rounds up; it is the coarsest mode and appears only when no BPE can be loaded.

Why can the same pasted text get different token counts per model?

Each model uses a tokenizer vocabulary and merge table. GPT-4-class and GPT-5-class encodings may differ; multilingual and code-heavy text changes average bytes per token. Changing the model dropdown switches the tokenizer path so you can compare counts side by side.

How does context window percentage work with the reserve field?

The context window is the maximum input tokens the model accepts for the entry in the catalog. The tool adds your counted tokens to the integer reserve (typically headroom for model output such as max_tokens). The percentage equals (tokens plus reserve) divided by the published context window. If the context is zero or unknown, the percentage is not meaningful.

How are estimated input, cached-input, and output costs computed?

Estimated input multiplies your token count by the catalog input per million tokens rate. The cached estimate multiplies the same token count by the optional cached-input rate and assumes all tokens qualify for that tier; real billing may split cached versus uncached prefixes. Output estimate multiplies the reserve by the output per million token rate. Missing rates display as an em dash.

Is the reference table a guarantee of charges?

No. Figures are bundled reference data with an as-of date and a pricing note. Providers change tiers, discounts, and regional pricing. External links point to official pages for verification. The table supports comparison and planning, not a binding quote.

Is prompt text uploaded to a server?

No. Tokenization runs in WebAssembly in your browser. The implementation only stores UI preferences in localStorage. Your pasted prompt text does not leave the page for this tool in the way the client is built.

How does split mode combine system, user, and assistant fields?

Non-empty sections are trimmed and joined with blank lines between sections. The combined string is tokenized. Assistant is optional for simulating prior turns; the tool does not call any API.

What does Add Output do, and how many blocks can I add?

Add Output captures the model and pricing options from Model & options at that moment and appends a new result card for the same combined prompt. Use it to compare token counts, usage percentage, and indicative costs across different catalog rows or custom rates. You can add up to 5 blocks; remove a block with Remove if you need a slot for another configuration.

What does including or excluding newlines in total characters change?

It only affects the character statistics cards, not the token count. Newlines remain in the combined text used for tokenization. Use it when you want editor-style character totals that include or exclude line breaks.

How often is the reference catalog updated?

The catalog JSON is shipped as /data/llm_models.json and loaded in the browser; it includes a catalog_as_of field in the reference section. Regenerate that file when upstream pricing changes (see scripts/generate_llm_models.py). Always verify production budgets against the provider.

Can I export the reference table?

Yes. Use Copy table (TSV) to copy tab-separated values for spreadsheets. Sorting and filters apply to the copied rows.

Why might billed tokens differ from this counter in production?

Providers may add system or tool prefixes, format JSON or XML, re-tokenize after tool results, or classify cached tokens differently. Streaming endpoints and batch jobs may round differently. Treat this tool as planning; use API metering for invoices.

Which OpenAI-style encodings does tiktoken-rs resolve in this WASM build?

The catalog maps model names and fallback keys such as o200k_base or cl100k_base to CoreBPE instances that match OpenAI tiktoken selections for compatible models.

Prompt input

Model & options

Reference data as of: 2026-04-08
Adds to usage %; used for output $ estimate.
Prompt text
Configure model options on the right, then click Add Output to compare multiple models on the same prompt (up to 5).