LLM Token Calculator
GPT Tokens & Cost
Count GPT tokens with model-aware tiktoken encodings, estimate input/output API cost from pasted prompts, and compare tokenizer results in your browser.
Token counts and costs are estimates from the selected model’s tokenizer and the prices configured here. Counting runs only in your browser.
Results
Tokens
0
Characters
0
Est. input cost
—
Est. output cost
—
Model
GPT-4o
Pricing: $2.5/1M input, $10/1M output
- Characters0
- Tokens0
- ModelGPT-4o
What is this tool?
This LLM token calculator counts how a pasted string splits into tokens for supported GPT and reasoning models, then estimates input and output cost from the $/1M rates configured on this page. Tokens are the billing and context-window unit for most language-model APIs.
Tokenization is model-specific. The same text can produce different counts across GPT-4o, GPT-4.1, GPT-3.5, and reasoning families because vocabularies and merge tables differ. English, CJK, emoji, whitespace, and code all behave differently.
Use it for prompt sizing, chunk planning, and quick cost sketches. Treat every dollar figure as an estimate tied to the rates shown under the KPI — verify live provider pricing before making budget decisions.
Common use cases
- Size a system or user prompt before calling a chat API
- Compare how CJK or code samples tokenize across model families
- Rough-estimate input vs output cost for the same token count
How to use
- Paste the prompt, message, or document chunk. Counts update live (debounced) — no Calculate click.
- Select the model from the dropdown (SSR-labeled Select).
- Read the top KPI: token count, character count, and estimated input/output cost for that count.
- Use Sample for a short release-notes prompt, Copy for a text summary, or Clear to reset.
Examples
| Input / setting | Output | Notes |
|---|---|---|
gpt-4o + Hello world | 2 tokens; 11 characters | Short English sample. |
gpt-4o + antidisestablishmentarianism | 6 tokens; 28 characters | One long English word → multiple subwords. |
gpt-4o + function add(a, b) { return a + b; } | 13 tokens | Small code snippet. |
안녕하세요 on gpt-4o vs gpt-3.5-turbo | ~2 vs ~5 tokens | CJK tokenizer gap — same string, different models. |
Practical pitfalls
- Estimates only: Configured $/1M rates can lag official price changes. Always check the provider’s current pricing page before budgeting.
- Tokenizer ≠ full bill: Chat templates, tool/function schemas, and multimodal tokens may add tokens the paste box does not see.
- Unique vs many “chars÷4” estimators: this page uses model-aware tiktoken encodings and shows input vs output cost for the same count side by side.
- Huge pastes can stress browser memory while the WASM tokenizer runs — keep chunks practical.
References
이 도구는 무엇인가요?
지원 GPT·reasoning 모델의 토큰 수를 세고, 이 페이지에 설정된 $/1M 요금으로 입력·출력 비용을 추정합니다. 토큰은 대부분의 LLM API에서 과금·컨텍스트 창의 단위입니다.
토큰화는 모델마다 다릅니다. 같은 문자열도 GPT-4o, GPT-4.1, GPT-3.5, reasoning 계열에서 어휘·머지 테이블 때문에 다른 개수가 나옵니다. 영어·CJK·이모지·공백·코드 동작이 제각각입니다.
프롬프트 길이 잡기, 청크 계획, 빠른 비용 스케치에 쓰세요. KPI 아래 요금표에 묶인 추정치이므로, 예산 전에는 제공자 최신 가격을 확인하세요.
자주 쓰는 경우
- 채팅 API 호출 전 시스템·유저 프롬프트 길이 확인
- 한글/CJK·코드 샘플의 모델별 토큰 차이 비교
- 동일 토큰 수를 입력·출력으로 썼을 때 대략 비용 비교
사용 방법
- 프롬프트나 문서 조각을 붙여넣습니다. 디바운스 후 라이브로 갱신됩니다(Calculate 불필요).
- 드롭다운에서 모델을 고릅니다.
- 상단 KPI에서 토큰 수·문자 수·추정 입력/출력 비용을 확인합니다.
- Sample로 예제 프롬프트를 넣고, Copy로 요약 복사, Clear로 초기화합니다.
예시
| 입력 / 설정 | 출력 | 메모 |
|---|---|---|
gpt-4o + Hello world | 2 tokens; 11 characters | 짧은 영어 |
gpt-4o + antidisestablishmentarianism | 6 tokens | 긴 영어 단어 → 여러 서브워드 |
gpt-4o + 작은 JS 함수 | 13 tokens | 코드 조각 |
안녕하세요 — gpt-4o vs gpt-3.5-turbo | 약 2 vs 5 tokens | 같은 한글, 모델별 차이 |
실무에서 흔한 실수
- 추정치: 설정된 $/1M이 공식 가격 변경보다 늦을 수 있습니다. 예산 전 제공자 가격표를 확인하세요.
- 토크나이저 ≠ 전체 청구: 채팅 템플릿·도구 스키마·멀티모달 토큰은 붙여넣기 칸에 안 보일 수 있습니다.
- 단순 “글자÷4” 추정과 달리 모델별 tiktoken을 쓰고, 동일 개수의 입력/출력 비용을 나란히 보여 줍니다.
- 매우 긴 붙여넣기는 WASM 토크나이저로 브라우저 메모리를 압박할 수 있습니다.
참고자료
このツールについて
対応する GPT・reasoning モデルのトークン数を数え、このページに設定された $/1M 単価で入出力コストを見積もります。トークンは多くの LLM API の課金・コンテキスト単位です。
トークン化はモデル固有です。同じ文字列でも語彙とマージ表の違いで件数が変わります。英語・CJK・絵文字・空白・コードの挙動も異なります。
プロンプト長の把握、チャンク計画、ざっくり費用試算に使ってください。KPI 下の単価に紐づく概算なので、予算前に提供元の最新価格を確認してください。
よくある用途
- チャット API 呼び出し前のシステム/ユーザープロンプト長確認
- CJK やコードのモデル別トークン差の比較
- 同じトークン数を入力/出力として扱った場合の概算費用
使い方
- プロンプトや文書片を貼り付けます。デバウンス後にライブ更新されます(Calculate 不要)。
- ドロップダウンでモデルを選びます。
- 上部 KPI でトークン数・文字数・推定入出力コストを確認します。
- Sample・Copy・Clear で例示・要約コピー・リセットできます。
例
| 入力 / 設定 | 出力 | メモ |
|---|---|---|
gpt-4o + Hello world | 2 tokens; 11 characters | 短い英語 |
gpt-4o + antidisestablishmentarianism | 6 tokens | 長い英単語 → 複数サブワード |
gpt-4o + 小さな JS 関数 | 13 tokens | コード片 |
안녕하세요 — gpt-4o vs gpt-3.5-turbo | 約 2 vs 5 tokens | 同じ CJK、モデル差 |
実務での落とし穴
- 概算です: 設定 $/1M は公式価格の更新より遅れることがあります。予算前に提供元を確認してください。
- トークナイザー ≠ 全請求: チャットテンプレート・ツール・マルチモーダル分は貼り付け欄に出ないことがあります。
- 「文字÷4」推定ではなくモデル対応 tiktoken を使い、同一件数の入出力コストを並べて示します。
- 極端に長い貼り付けは WASM トークナイザーでブラウザメモリを圧迫し得ます。
参考資料
¿Qué es esta herramienta?
Cuenta tokens para modelos GPT y reasoning compatibles y estima el coste de entrada/salida con las tarifas $/1M configuradas en esta página. Los tokens son la unidad de facturación y de ventana de contexto en la mayoría de APIs de LLM.
La tokenización depende del modelo. El mismo texto puede dar recuentos distintos entre GPT-4o, GPT-4.1, GPT-3.5 y familias reasoning. Inglés, CJK, emoji, espacios y código se comportan distinto.
Úsalo para dimensionar prompts, planificar chunks y bocetos de coste. Cada cifra en dólares es una estimación ligada a las tarifas del KPI: verifica el precio actual del proveedor antes de presupuestar.
Casos de uso comunes
- Medir un system/user prompt antes de llamar a la API de chat
- Comparar cómo se tokenizan CJK o código entre familias de modelos
- Estimar coste de entrada vs salida para el mismo recuento
Cómo usar
- Pega el prompt o fragmento. El recuento se actualiza en vivo (con debounce); no hace falta Calculate.
- Elige el modelo en el desplegable.
- Lee el KPI superior: tokens, caracteres y coste estimado de entrada/salida.
- Usa Sample, Copy o Clear según necesites.
Ejemplos
| Entrada / configuración | Salida | Notas |
|---|---|---|
gpt-4o + Hello world | 2 tokens; 11 characters | Inglés corto |
gpt-4o + antidisestablishmentarianism | 6 tokens | Palabra larga → varios subwords |
gpt-4o + función JS pequeña | 13 tokens | Fragmento de código |
안녕하세요 — gpt-4o vs gpt-3.5-turbo | ~2 vs ~5 tokens | Misma cadena CJK, distinto modelo |
Errores prácticos
- Solo estimaciones: las tarifas $/1M configuradas pueden retrasarse respecto al precio oficial.
- Tokenizer ≠ factura completa: plantillas de chat, tools y multimodal pueden añadir tokens no visibles aquí.
- A diferencia de estimadores “chars÷4”, usa encodings tiktoken por modelo y muestra coste de entrada y salida juntos.
- Pegados enormes pueden saturar la memoria del navegador con el tokenizer WASM.
Referencias
Qu'est-ce que cet outil ?
Compte les tokens pour les modèles GPT et reasoning pris en charge, puis estime le coût d’entrée/sortie avec les tarifs $/1M configurés sur cette page. Les tokens sont l’unité de facturation et de fenêtre de contexte de la plupart des API LLM.
La tokenisation dépend du modèle. Le même texte peut donner des comptes différents entre GPT-4o, GPT-4.1, GPT-3.5 et les familles reasoning. Anglais, CJK, emoji, espaces et code se comportent différemment.
Utile pour dimensionner un prompt, planifier des chunks et esquisser un coût. Chaque montant est une estimation liée aux tarifs du KPI — vérifiez le prix actuel chez le fournisseur avant un budget.
Cas d'usage courants
- Mesurer un prompt système/utilisateur avant un appel chat
- Comparer la tokenisation CJK ou code entre familles de modèles
- Estimer le coût entrée vs sortie pour le même nombre de tokens
Comment utiliser
- Collez le prompt ou le fragment. Le compte se met à jour en direct (debounce) — pas de bouton Calculate.
- Choisissez le modèle dans la liste.
- Lisez le KPI du haut : tokens, caractères, coût estimé entrée/sortie.
- Utilisez Sample, Copy ou Clear selon besoin.
Exemples
| Entrée / réglage | Sortie | Notes |
|---|---|---|
gpt-4o + Hello world | 2 tokens; 11 characters | Anglais court |
gpt-4o + antidisestablishmentarianism | 6 tokens | Mot long → plusieurs sous-mots |
gpt-4o + petite fonction JS | 13 tokens | Extrait de code |
안녕하세요 — gpt-4o vs gpt-3.5-turbo | ~2 vs ~5 tokens | Même CJK, modèles différents |
Pièges courants
- Estimations seulement : les $/1M configurés peuvent retarder les changements de prix officiels.
- Tokenizer ≠ facture complète : gabarits de chat, tools et multimodal peuvent ajouter des tokens invisibles ici.
- Contrairement aux estimateurs « caractères÷4 », cette page utilise tiktoken par modèle et affiche coût entrée/sortie côte à côte.
- Les collages énormes peuvent saturer la mémoire du navigateur avec le tokenizer WASM.
Références
这个工具是什么?
为受支持的 GPT 与 reasoning 模型统计 token,并用本页配置的 $/1M 单价估算输入/输出费用。Token 是多数 LLM API 的计费与上下文窗口单位。
分词因模型而异。同一字符串在 GPT-4o、GPT-4.1、GPT-3.5 与 reasoning 系列上可能得到不同数量。英文、CJK、emoji、空白与代码表现各不相同。
适合做提示词长度检查、分块规划与粗略费用估算。KPI 下的单价绑定的是估算值——做预算前请核对供应商最新价格。
常见用途
- 调用聊天 API 前估算 system/user 提示长度
- 对比 CJK 或代码在不同模型上的 token 差异
- 对同一 token 数分别按输入/输出估算费用
如何使用
- 粘贴提示或文档片段。计数会防抖后实时更新,无需点击 Calculate。
- 在下拉框选择模型。
- 查看顶部 KPI:token 数、字符数与估算输入/输出费用。
- 使用 Sample / Copy / Clear。
示例
| 输入 / 设置 | 输出 | 说明 |
|---|---|---|
gpt-4o + Hello world | 2 tokens;11 字符 | 短英文 |
gpt-4o + antidisestablishmentarianism | 6 tokens | 长英文词 → 多个子词 |
gpt-4o + 小型 JS 函数 | 13 tokens | 代码片段 |
안녕하세요 — gpt-4o vs gpt-3.5-turbo | 约 2 vs 5 tokens | 同串 CJK、不同模型 |
实践中的常见误区
- 仅为估算: 配置的 $/1M 可能落后于官方调价。预算前请查供应商价格页。
- 分词器 ≠ 完整账单: 聊天模板、工具 schema、多模态 token 可能不在粘贴框内。
- 不同于“字符÷4”估算器:本页使用按模型的 tiktoken,并并排显示输入/输出费用。
- 超长粘贴可能在 WASM 分词时占用较多浏览器内存。
参考资料
這個工具是什麼?
為支援的 GPT 與 reasoning 模型統計 token,並用本頁設定的 $/1M 單價估算輸入/輸出費用。Token 是多數 LLM API 的計費與上下文視窗單位。
分詞因模型而異。同一字串在 GPT-4o、GPT-4.1、GPT-3.5 與 reasoning 系列上可能得到不同數量。英文、CJK、emoji、空白與程式碼表現各不相同。
適合做提示詞長度檢查、分塊規劃與粗略費用估算。KPI 下的單價綁定的是估算值——做預算前請核對供應商最新價格。
常見用途
- 呼叫聊天 API 前估算 system/user 提示長度
- 對比 CJK 或程式碼在不同模型上的 token 差異
- 對同一 token 數分別按輸入/輸出估算費用
如何使用
- 貼上提示或文件片段。計數會防抖後即時更新,無需點 Calculate。
- 在下拉選單選擇模型。
- 查看頂部 KPI:token 數、字元數與估算輸入/輸出費用。
- 使用 Sample / Copy / Clear。
範例
| 輸入 / 設定 | 輸出 | 說明 |
|---|---|---|
gpt-4o + Hello world | 2 tokens;11 字元 | 短英文 |
gpt-4o + antidisestablishmentarianism | 6 tokens | 長英文詞 → 多個子詞 |
gpt-4o + 小型 JS 函式 | 13 tokens | 程式碼片段 |
안녕하세요 — gpt-4o vs gpt-3.5-turbo | 約 2 vs 5 tokens | 同串 CJK、不同模型 |
實務上常見陷阱
- 僅為估算: 設定的 $/1M 可能落後於官方調價。預算前請查供應商價格頁。
- 分詞器 ≠ 完整帳單: 聊天範本、工具 schema、多模態 token 可能不在貼上框內。
- 不同於「字元÷4」估算器:本頁使用依模型的 tiktoken,並並排顯示輸入/輸出費用。
- 超長貼上可能在 WASM 分詞時佔用較多瀏覽器記憶體。
參考資料
Last reviewed: 2026-07-27
Frequently asked questions
- Are the token counts exact for the OpenAI API?
- Counts use the bundled tiktoken library with a model-aware encoding, which matches common OpenAI chat tokenizers closely. Chat templates, tools, and image tokens can still differ from what the API bills.
- Are cost estimates official prices?
- No. Costs multiply the counted tokens by the $/1M rates configured in this tool. Always verify current provider pricing before budgeting.
- Does it count output tokens separately?
- It counts the pasted text once, then shows estimated cost if that same token count were billed as input or as output. It does not simulate a model completion.
- Is my prompt uploaded?
- No. Tokenization and cost math run locally in your browser after the tokenizer loads.