Toolivaro

無料のAI トークン数カウンター

GPT-4o、Claude Sonnet 4 などのモデルで、プロンプトのトークン数と API コストを概算します。完全にローカルで動作します。

AI トークンカウンターは、OpenAI と Anthropic のモデルでプロンプトが消費するトークン数を概算し、API コストの見積もりに換算します。プロンプト、システムメッセージ、コードブロックを貼り付け、モデルファミリーを選ぶと、入力トークン数の推定値、コンテキストウィンドウのチェック、そして期待される出力長を入力すれば入力+出力の合計コストが返されます。推定には各ベンダーが公表しているヒューリスティック(英語テキストではおよそトークン 1 個につき文字 4 文字)を使います。これは概算であってモデルの正確なトークナイザーではなく、英語以外のテキスト、句読点の多いテキスト、コードでは精度が特に落ちます。料金は 2026-08-05 時点で記録した公開リスト価格であり、基準日付きで表示されるため、ベンダー側の変更が黙って誤った見積もりになることはありません。すべてローカルで処理されるため、貼り付けたプロンプトがデバイスの外に出ることはありません。独自コードや機密データを含むテキストでは重要です。バッチジョブの前に支出を確認したいとき、タスクにモデルファミリーを比較するとき、コンテキストウィンドウのエラーでプロンプトが手で数えるには大きすぎるとわかったときにご利用ください。

ブラウザ内でローカル処理されます

任意です。出力トークンの費用の見積もりに使われます。

この計算機の使い方

What a token is, and why the count is an estimate

A token is the unit a language model reads and writes: roughly a word, a sub-word, or a punctuation mark, depending on the model’s vocabulary. Models are billed per token, and their context windows are measured in tokens, which is why the number matters before you send a prompt. The tool estimates the count with the vendors’ own documented heuristic — about one token per four characters of English text — rather than each model’s exact tokenizer, whose BPE vocabulary is far too large to ship in a static page.

The estimate is calibrated for English prose. Non-English text, dense punctuation, code with long identifiers, and tables all tokenize differently, and the page says so plainly: for billing-critical counts the vendor tokenizer is authoritative, and this tool is for planning — sanity-checking spend before a batch job, comparing model families, or finding out why a prompt overflowed its context window.

Estimating cost before you commit

Cost is two numbers, not one: input tokens and output tokens, and they are billed at different rates — output almost always costs more per token. The tool asks for an expected output length when you want the full picture, estimates output tokens at roughly 0.75 words per token, and combines both sides at the model’s public list prices.

The prices are shown with the date they were recorded (2026-08-05) because model pricing changes — a rate update at the vendor is never silently baked into an estimate. When you are planning a real workload, confirm the current rates on the vendor’s pricing page; the tool’s job is the arithmetic, not the price forecast.

Choosing a model family for the job

The counter lets you compare models side by side: the same prompt can be 250 tokens on one family and 220 on another, and the input cost per million tokens differs enough that the comparison changes real decisions about batch size and routing. Run the same prompt across the families you are considering and read the combined cost — that is the number that belongs in a budget review, not the token count alone.

The context-window check is the other side of the comparison: a prompt that fits comfortably in one family’s window may not fit a smaller-window model at all, and the tool flags that before you discover it in an API error.

The local promise

Prompts you paste here often contain proprietary code, unpublished plans, or personal data — exactly the text you should not send to a third-party tokenizer. Everything runs in your browser: the estimate is computed locally, nothing is uploaded, logged, or stored, and there is no server that could see the text. The trade is the one disclosed above: the count is the documented heuristic rather than the exact vocabulary, which is the honest price of keeping the prompt on your device.

結果はどうやって計算されるの?

GPT-4o での 200 語のシステムプロンプト

1,000 文字のシステムプロンプトは、GPT-4o では 250 トークンと推定されます(トークン 1 個につき 4 文字)。入力トークン 100 万個あたり $2.50 の場合、入力コストは約 $0.0006 です。要求した 200 語の回答(100 万個あたり $10 で約 267 出力トークン)を加えると、1 回の呼び出しあたり約 $0.0033 になります。

入力と出力の例
入力
prompt 1,000-character system prompt
model GPT-4o
outputWords 200
結果 ≈ 250 入力トークン ・ ≈ 267 出力トークン ・ ≈ 1 回あたり $0.0033

計算式と前提は?

トークン数の概算

tokens ≈ ceil(characters ÷ 4)

計算式の記号
記号 意味
characters プロンプトテキストの長さ(コードポイント数)
4 ベンダー公表の近似: トークン 1 個あたり約 4 文字(英語)

概算であり、トークナイザーの正確な出力ではありません。正確な数値には各モデルの BPE 語彙が必要ですが、静的ページに組み込むことはできません。

コストの見積もり

cost = (inputTokens ÷ 1,000,000 × inputPrice) + (outputTokens ÷ 1,000,000 × outputPrice)

計算式の記号
記号 意味
inputPrice 入力トークン 100 万個あたりのリスト価格(2026-08-05 時点)
outputPrice 出力トークン 100 万個あたりのリスト価格(2026-08-05 時点)

出力トークンは、期待される出力長が指定された場合、トークン 1 個あたり約 0.75 語で推定します。

よくある間違いは?

  • 概算を正確な請求数値とみなすこと。請求にはベンダーのトークナイザーが正となります。
  • 英語以外のテキストでもトークン 1 個につき 4 文字だと思うこと。このヒューリスティックは英語向けに調整されています。
  • 出力トークンは通常、入力トークンより 1 個あたりのコストが高いことを忘れること。
  • 機密の独自コードをオンラインのトークナイザーに貼り付けること。このツールはすべてローカルで処理します。

前提と制限は?

  • 推定はヒューリスティック(文字数 ÷ 4)であり、モデルの正確なトークナイザー出力ではありません。英語以外のテキスト、句読点の多いテキスト、コードでは精度が落ちます。
  • 料金は 2026-08-05 時点の公開リスト価格であり、変更されることがあります。支出を確定する前に必ずベンダーの料金ページで確認してください。
  • コンテキストウィンドウと料金は、記録された日付時点の記載モデル名に適用されます。モデルの更新で両方が変わる可能性があります。

数値の出典は?

最終確認 2026年8月5日 · バージョン 1.0.0 · Toolivaro 外部コンテンツを保証するものではありません。

よくある質問

なぜ正確な数ではなく概算なのですか?

正確なトークン数は各モデルのトークナイザー、つまりモデルプロバイダーのライブラリに組み込まれた BPE 語彙から得られるもので、静的ページに埋め込むには大きすぎます。公表されている文字 4 個あたりトークン 1 個のヒューリスティックは、典型的な英語のプロンプトでは数パーセント以内に収まり、コストやコンテキストの計画には十分な精度です。

OpenAI や Anthropic のトークナイザーページと数は一致しますか?

近いですが、完全に同一ではありません。公式のトークナイザーは実際の語彙を使い正確です。このツールはブラウザだけで動作させるため、公表されているヒューリスティックを使用しています。請求に関わる数値にはベンダーのトークナイザーを使ってください。ここの概算は計画用です。

料金に日付が付いているのはなぜですか?

モデルの料金は変わります。このツールは作成時に記録した公開リスト価格(2026-08-05)をすべての結果とともに表示するため、その後のベンダーの値上げが黙って見積もりに織り込まれることはありません。

Does the tool count output tokens for me?

Only when you provide an expected output length. Output tokens are estimated at roughly 0.75 words per token and combined with input cost at the model’s output rate. Without a length, the tool reports input cost alone.

Why is my code tokenized so differently from my prose?

Tokenizer vocabularies are trained on the language they see most: prose-heavy text tokenizes near the four-characters-per-token average, while code and non-English text drift from it. That is the main reason the estimate is an approximation rather than an exact count.

このコレクションの一部 開発者向けテキスト・JSONツールキット

間違いを見つけましたか? 報告する — すべての修正を確認します.

このツールは役に立ちましたか?

Toolivaro編集チームが当社の方法論に基づいてレビュー済み 計算方法 · 編集方針