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.
💡 Defaults are placeholders — always confirm current rates on the provider's official pricing page.
How to use
- Paste your text — see instant character, word and estimated token counts.
- Set the rates — enter the model's $ per 1M input and output tokens (defaults provided, always editable).
- 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?
Why editable rates instead of a fixed price table?
Is my text uploaded anywhere?
How many tokens is 1,000 words?
How is API cost calculated per token?
Why do different models count the same text differently?
Do tokens include the whole conversation or just my prompt?
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
The complete ai token counter guide
Prefer the long version — a worked example, the mistakes people actually make, and answers to real questions? The blog guide AI Token Counter — Complete Guide, Mistakes & FAQ covers all of it step by step.
Browse the collection: Developer Tools — All 46 Free Online Tools