search
format_align_left
JSON Formatter CSS Formatter HTML Formatter JavaScript Formatter XML Formatter SQL Formatter Exception Formatter Markdown Preview & HTML to Markdown
data_object
JSON to Excel/CSV JSON to TypeScript, C#, Go, Java, Kotlin, Python & Dart JSON ⇄ YAML / TOML Converter JSON Diff – Compare Two JSON JSON Viewer & JSONPath Tester
table_chart
Excel/CSV to JSON Excel/CSV to SQL Excel/CSV to HTML
description
Compare text Text to Hex Text to Base64 Case Converter Regex Tester Vietnamese Accent Remover & Slug Generator Number to Words Word Counter Line Tools: Remove Duplicates, Sort Lines Lorem Ipsum Generator
auto_awesome
Fix JSON from ChatGPT, Claude & Gemini Token Counter & AI API Cost Calculator ChatGPT Markdown to Word & Google Docs
image
Convert Image Image to Base64 Converter Image Compressor Resize & Crop Image Favicon Generator Color Palette from Image EXIF Viewer & Remover
qr_code_2
QR Code Generator QR Code Scanner VietQR Bank Transfer QR Generator Wi-Fi QR Code Generator vCard QR Code Generator (Business Card) Barcode Generator (EAN-13, Code 128, Code 39)
lock
Convert Token Convert Hash Generate Password HMAC Generator (SHA-256, SHA-512) AES Encrypt / Decrypt Online Bcrypt Hash Generator & Checker SSH Key Generator (Ed25519 / RSA)
schedule
Convert datetime Timezone Info Vietnamese Lunar Calendar Converter Age Calculator Date Calculator Cron Expression Parser Countdown Timer
payments
Gross to Net Salary Calculator (Vietnam 2026) Vietnam Personal Income Tax Calculator (2026) Loan Calculator – Monthly Payment & Schedule Savings Interest Calculator (Term Deposit) VAT Calculator – Add or Remove VAT
link
Encode and Decode URLs Shorten URL URL Parser & UTM Builder HTTP Header Checker
storage
Statistics Parser Statistics Compare SQL INSERT to JSON Converter SQL Table to C# / TypeScript / Java Class
travel_explore
Create Sitemap robots.txt Generator Meta Tag Generator Open Graph Preview
terminal
Number Base Converter UUID / ULID / NanoID Generator Chmod Calculator HTTP Status Codes
palette
Color Picker
help_outline
About UsPrivacy PolicyTerms of ServiceContact
THUTOOL
search

Token Counter & AI API Cost Calculator

🔒 Processed 100% in your browser – your data never leaves your device
Result
0Tokens
0Characters
0Words

Counted with the GPT tokenizer (o200k_base): exact for GPT-5.x models, an estimate (≈) for Claude and Gemini.

ModelInput / 1MOutput / 1MPer requestTotal
GPT-5.6 Sol$4$20$0.01$0.01
GPT-5.6 Terra$2$12$0.006$0.006
GPT-5.6 Luna$0.2$1.2$0.0006$0.0006
GPT-5.5$5$30$0.015$0.015
GPT-5.4 mini$0.75$4.5$0.00225$0.00225
GPT-5.4 nano$0.2$1.25$0.000625$0.000625
Claude Fable 5.2 ≈$8$40$0.02$0.02
Claude Opus 5.5 ≈$4$20$0.01$0.01
Claude Sonnet 5.5 ≈$2$10$0.005$0.005
Claude Haiku 5.5 ≈$0.1$0.5$0.00025$0.00025
Gemini 4 Carbon ≈$4$20$0.01$0.01
Gemini 3.8 Flash ≈$0.75$3.75$0.001875$0.001875
Gemini 3.5 Flash-Lite ≈$0.3$2.5$0.00125$0.00125

Standard API prices in USD on 2026-11-21 (no batch or cache discount). Check the latest prices: OpenAI · Anthropic · Google


How to count tokens and estimate the cost of an AI API call

AI models such as GPT, Claude and Gemini read text as tokens – pieces of words – and the API is billed per million tokens. This token counter shows how many tokens your text has and what one request or many requests cost on each model. The text is counted in your browser and is not sent anywhere.

  1. Paste your prompt into Prompt or text. Include the system prompt and the chat history if you send them with every request.
  2. Read the token count under Result.
  3. Enter Output tokens per request – about how long you expect the answer to be – and the Number of requests, for example 30,000 for a month of 1,000 requests per day.
  4. Compare the Per request and Total columns of the table.
  5. Tick Show how the text is split into tokens to see each token highlighted.

Example

Claude Opus 5.5 costs $4 per 1M input tokens and $20 per 1M output tokens. A 1,000-token prompt with a 500-token answer costs (1,000 × 4 + 500 × 20) / 1,000,000 = $0.014 per request, or $420 for 30,000 requests.

FAQ

How many tokens is one word?
In English one token is about 4 characters, so 100 words are roughly 130 tokens. Vietnamese, Japanese, Hindi and other languages usually need more tokens for the same text.

Why is the Claude and Gemini count marked ≈?
Each company uses its own tokenizer and only OpenAI's can run in the browser. For an exact Claude or Gemini count, use the token counting endpoint of their API.

Is the price exact?
The table uses the standard list prices on the date shown. Batch processing, prompt caching, long prompts and thinking tokens change the real bill – check the provider's pricing page before you budget.

Related tools

  • Fix JSON from ChatGPT, Claude & GeminiPaste an AI answer and get valid JSON: removes ```json fences and chatter, fixes quotes, trailing commas, True/None and closes cut-off output.
  • ChatGPT Markdown to Word & Google DocsTurn a ChatGPT, Claude or Gemini answer in Markdown into a formatted Word document: copy with tables and headings for Word or Google Docs, or download .doc.
  • XML FormatterFormat, validate and minify XML, view it as a tree or convert XML to JSON. Free online XML formatter that shows the exact error line.
  • QR Code GeneratorCreate QR codes with custom colours, a centre logo and error correction, then download PNG or SVG. Free and runs in your browser.
  • Image to Base64 ConverterConvert images (PNG, JPG, GIF, WebP, SVG, ICO) to Base64, data URI, CSS or HTML, and decode Base64 back to an image. 100% in your browser.
  • JSON to TypeScript, C#, Go, Java, Kotlin, Python & DartGenerate TypeScript interfaces, C#/Java/Kotlin classes, Go structs, Python dataclasses/Pydantic and Dart models from JSON. Runs in your browser.
About UsPrivacy PolicyTerms of ServiceContact
@Made by THUTOOL