AI Token Counter — Estimate Tokens & API Cost Before You Pay

Paste text to estimate token count and API cost across models, with editable $/1M input-output rates so the math always matches current pricing.

Quick answer: Free AI token counter: estimate tokens for ChatGPT, Claude and Gemini, and calculate API costs from editable per-million rates. Instant and private.

0Characters
0Words
0Est. tokens
$0.000000Input cost
$0.000000Projected total (incl. output)

💡 Defaults are placeholders — always confirm current rates on the provider's official pricing page.

How to use

  1. Paste your text — see instant character, word and estimated token counts.
  2. Set the rates — enter the model's $ per 1M input and output tokens (defaults provided, always editable).
  3. Read the cost — estimated input cost, and projected total if you also set expected output tokens.

About this tool

LLMs read text as tokens — roughly one token per 4 characters or ¾ of a word in English. Providers bill per million tokens with separate input and output rates. This counter estimates tokens from your text using the standard ≈chars/4 heuristic, then multiplies by editable per-model rates — update the two numbers whenever pricing changes and the cost math stays honest. Nothing is sent anywhere. Every AI token calculator walks a line: exact counts require each provider's own tokenizer, while this tool uses the industry-standard heuristic — roughly one token per 4 characters or ¾ of a word in English — which lands within a few percent for typical prose and is instantly good enough for the real question: what will this prompt cost. The pricing side is deliberately manual. Providers reshuffle per-million rates and add cache discounts often enough that any hard-coded price table eventually lies to you; entering the two numbers from the provider's current pricing page keeps the math permanently honest. Remember the asymmetry that surprises everyone: input tokens are what you send, output tokens are what the model generates — and output rates are usually several times higher, so a chatty model on a cheap input can still be an expensive call. Context limits count both together.

FAQ

How accurate is the token estimate?
For English text, the ≈4-chars-per-token heuristic lands within a few percent of real tokenizer counts; other languages can vary more. Use it for budgeting, not billing.
Why editable rates instead of a fixed price table?
AI pricing changes monthly — editable rates mean you always calculate with the real current numbers from the provider's pricing page.
Is my text uploaded anywhere?
No — counting happens entirely in your browser.
How many tokens is 1,000 words?
For English prose, roughly 1,300–1,400 tokens (¾ of a word per token). Paste a sample above and the counter shows the ratio for your exact text — technical text with code or URLs runs heavier, up to one token per word or more.
How is API cost calculated per token?
Cost = input tokens × input rate + output tokens × output rate, with both rates priced per million. Example: 2,000 input and 800 output tokens at $3/$15 per million costs 0.002 × 3 + 0.0008 × 15 = $0.018. Enter your model's current rates in the tool to automate this.
Why do different models count the same text differently?
Each provider trains its own tokenizer: one may compress “unbelievable” into three tokens, another into four. The ≈4-chars heuristic is deliberately model-agnostic — close enough for budgeting, while exact billing always comes from the provider's own count.
Do tokens include the whole conversation or just my prompt?
Every turn re-sends the conversation so far, so a 10-message chat bills the growing context each time — later messages cost more than the first even at identical length. Long chats benefit from summarizing or restarting threads.

Rate this tool

Your rating stays in this browser (local storage) — nothing is sent to any server.

Related tools

{ }

JSON Formatter

Developer Tools

🔀

CSV to JSON Converter

Developer Tools

🔍

Regex Tester

Developer Tools

🔤

Base64 Encoder / Decoder

Developer Tools

🌐

URL Encoder / Decoder

Developer Tools

#️⃣

Hash Generator (MD5 & SHA)

Developer Tools

🆔

UUID Generator

Developer Tools

⏱️

Epoch Timestamp Converter

Developer Tools

🎟️

JWT Decoder

Developer Tools

⏰

Cron Expression Generator

Developer Tools

🧪

Fake Person Generator

Developer Tools

📧

Fake Email Generator

Developer Tools

✅

Credit Card Validator

Developer Tools

📱

Phone Number Validator

Developer Tools

📨

Email Validator

Developer Tools

💾

Data Storage Converter

Developer Tools

🧬

HTML Encoder / Decoder

Developer Tools

🧾

JSON to CSV Converter

Developer Tools

🔁

CSV to JSON Converter

Developer Tools

📐

XML Formatter / Beautifier

Developer Tools

🗄️

SQL Formatter

Developer Tools

📝

Markdown Previewer

Developer Tools

🌐

IP Subnet Calculator

Developer Tools

🕒

Unix Timestamp Converter

Developer Tools

🌈

CSS Gradient Generator

Developer Tools

🌓

CSS Box Shadow Generator

Developer Tools

🚦

HTTP Status Code Lookup

Developer Tools

🛰️

What Is My IP

Developer Tools

🔎

WHOIS Lookup (RDAP)

Developer Tools

🛡️

Password Breach Checker

Developer Tools

⚡

Internet Speed Test

Developer Tools

🧪

Fake JSON / API Data Generator

Developer Tools

🔌

REST API Tester

Developer Tools

🌍

DNS Lookup

Developer Tools

📑

Markdown to HTML Converter

Developer Tools

🗂️

ZIP File Extractor

Developer Tools

📦

ZIP File Creator

Developer Tools

🔏

File Checksum Verifier

Developer Tools

📷

Webcam Test

Developer Tools

🎙️

Microphone Test

Developer Tools

⌨️

Keyboard Tester

Developer Tools

🕵️

User Agent Checker

Developer Tools

🖥️

Screen Resolution Checker

Developer Tools

🗝️

Passphrase Generator

Developer Tools

🔒

AES Encrypt / Decrypt

Developer Tools

🛡️

WebRTC Leak Test

Developer Tools

🟥

Dead Pixel Test

Developer Tools