跳至主要内容

LLM Token 计数器

统计 GPT、Claude 和 Gemini 的 token 数,并比较 30 多个模型的 API 费用。OpenAI 计数精确,Claude 和 Gemini 为明确标注的估算值,价格均为当前价格。

100% 客户端 · 没有数据离开您的浏览器
OpenAI tokens
o200k_base, exact
Claude tokens
…
estimate
Gemini tokens
≈110
estimate 88–138
Characters
427
433 bytes
Words
67
9 lines

See the tokens

How OpenAI's o200k_base tokenizer splits your text. Each colour is one token.

Cost

List prices per 1M tokens, checked 2026-11-15. Promotional prices switch to the regular price on their end date.

The model's reply (thinking counts as output)

e.g. per day or per month

Prompt caching bills repeated prefixes at the cached rate

ModelInput tokens$ / 1M in$ / 1M outPer request× 1,000
GPT-6 Astra
OpenAI · gpt-6-astra
…$10$50……
GPT-6.1 Sol
OpenAI · gpt-6.1-sol
…$2$10……
GPT-6.1 Terra
OpenAI · gpt-6.1-terra
…$1$5……
GPT-6 Luna
OpenAI · gpt-6-luna
…$0.10$0.50……
GPT-5.6 Sol
OpenAI · gpt-5.6-sol · Promotional price until 30 Nov 2026.
…$4$20……
GPT-5.6 Terra
OpenAI · gpt-5.6-terra
…$2$12……
GPT-5.6 Luna
OpenAI · gpt-5.6-luna
…$0.20$1.20……
GPT-5.5
OpenAI · gpt-5.5
…$5$30……
GPT-5.4
OpenAI · gpt-5.4
…$2.50$15……
GPT-5.4 mini
OpenAI · gpt-5.4-mini
…$0.75$4.50……
GPT-5.4 nano
OpenAI · gpt-5.4-nano
…$0.20$1.25……
GPT-5 mini
OpenAI · gpt-5-mini
…$0.25$2……
GPT-5 nano
OpenAI · gpt-5-nano
…$0.05$0.40……
GPT-4.1
OpenAI · gpt-4.1
…$2$8……
GPT-4o
OpenAI · gpt-4o
…$2.50$10……
GPT-4o mini
OpenAI · gpt-4o-mini
…$0.15$0.60……
o3
OpenAI · o3
…$2$8……
Claude Fable 5.2
Anthropic · claude-fable-5-2
…$8$40……
Claude Opus 5.5
Anthropic · claude-opus-5-5
…$4$20……
Claude Sonnet 5.5
Anthropic · claude-sonnet-5-5
…$2$10……
Claude Haiku 5.5
Anthropic · claude-haiku-5-5
…$0.10$0.50……
Claude Opus 5
Anthropic · claude-opus-5
…$5$25……
Claude Sonnet 5
Anthropic · claude-sonnet-5
…$2$10……
Claude Opus 4.8
Anthropic · claude-opus-4-8
…$5$25……
Claude Sonnet 4.6
Anthropic · claude-sonnet-4-6
…$3$15……
Claude Haiku 4.5
Anthropic · claude-haiku-4-5
…$1$5……
Gemini 4 Argon
Google · gemini-4-argon · Introductory price until 30 Nov 2026, then $4 / $20.
≈110$2$10$0.00522$5.22
Gemini 4 Carbon
Google · gemini-4-carbon · Introductory price until 30 Nov 2026, then $4 / $20.
≈110$2$10$0.00522$5.22
Gemini 4 Hydrogen
Google · gemini-4-hydrogen
≈110$1.50$7.50$0.00392$3.92
Gemini 3.8 Flash
Google · gemini-3.8-flash · Introductory price until 31 Dec 2026, then $1.50 / $7.50.
≈110$0.75$3.75$0.00196$1.96
Gemini 3.1 Pro (preview)
Google · gemini-3.1-pro-preview
≈110$2$12$0.00622$6.22
Gemini 3.5 Flash-Lite
Google · gemini-3.5-flash-lite
≈110$0.30$2.50$0.00128$1.28
Gemini 3 Flash (preview)
Google · gemini-3-flash-preview
≈110$0.50$3$0.00155$1.55
Gemini 2.5 Flash-Lite
Google · gemini-2.5-flash-lite
≈110$0.10$0.40$0.00021$0.211
Your own price (counted with o200k_base; cache at 10%)
………

Standard tier list prices in USD. Batch APIs usually cost about half; regional endpoints, priority/fast modes and taxes cost more. ≈ marks estimated token counts.

How accurate are the counts?

  • OpenAI: exact for GPT-4o, GPT-4.1, GPT-5 (mini, nano) and o3, which use o200k_base. For GPT-5.x and GPT-6 models OpenAI hasn't published the tokenizer, so the same count is shown as ≈.
  • Claude: Anthropic has no public tokenizer. OpenAI's tokenizer undercounts Claude by about 15–20% on English and more on code and other languages, so the estimate scales up with your text. For the exact number, use Anthropic's free token-counting endpoint:
Exact Claude count (TypeScript SDK)
import Anthropic from "@anthropic-ai/sdk";

const client = new Anthropic();
const { input_tokens } = await client.messages.countTokens({
  model: "claude-opus-5-5",
  messages: [{ role: "user", content: text }],
});

Gemini: estimated at about 4 characters per token (Google's guidance), adjusted for code and non-Latin scripts. The Gemini API's countTokens method gives the exact figure.

关于此工具

粘贴提示词、文档或聊天记录,即可使用 OpenAI 的 o200k_base 分词器统计 token 数,查看文本如何被切分为 token,并获得 Claude 和 Gemini 的估算 token 数(它们的分词器未公开)。然后比较同一请求在当前 OpenAI、Anthropic 和 Google 模型上的费用:设置回复长度、请求次数以及提示词中有多少来自缓存,并按价格排序。工具会处理长上下文价格和会到期的促销价格,您也可以按自己的价格添加模型。分词器在您的浏览器中加载,您的文本不会被发送到任何地方。

如何统计 token 并估算费用

统计提示词的 token 数并比较各模型的价格。

  1. 1

    粘贴文本

    粘贴提示词、文档或对话。

  2. 2

    设置用量

    输入预计的回复长度、请求次数以及提示词中被缓存的比例。

  3. 3

    比较模型

    查看每个模型的单次请求费用和总费用,或按价格从低到高排序。