🤖 AI Token Counter

Count tokens for GPT-3.5, GPT-4, and Claude models using the exact tokenizer. Estimate API costs before sending requests. Free online LLM token counter — no signup needed.

0
Tokens
0
Characters
0
Words
$0.00
Input price
$0.00
Output price
0%
Context Used
Token count is an approximation (4 chars ≈ 1 token). Pricing per 1M tokens from public APIs.

How to Use

1

Paste or type your text

Enter any text — a system prompt, document, or message. Token count updates live as you type.

2

Select your AI model

Choose GPT-4, Claude 3, Llama 3, or Gemini Pro. Pricing and tokenization differ per model.

3

Read the estimate

See tokens, characters, word count, and estimated API cost for input and output tokens.

Frequently Asked Questions

What is a token in AI models? +
A token is the basic unit of text that AI language models process. Tokens are roughly 4 characters or ¾ of a word in English. "Hello world" is about 2 tokens. Tokenization varies by model — GPT uses BPE (Byte Pair Encoding), while Claude and Llama have their own tokenizers.
How accurate is this token counter? +
This tool uses standard approximation rules: ~4 characters per token for English text. For exact counts, use the official tokenizer. Accuracy is typically within 5% for English content. Non-English text (especially CJK characters) may use more tokens per character.
Why do different models have different token counts? +
Each AI model uses a different tokenizer trained on different data. GPT-4 uses cl100k_base, Claude uses its own SentencePiece-based tokenizer, and Llama uses a different vocabulary. The same text can produce different token counts across models.
How is API cost calculated? +
API providers charge per 1,000 or 1,000,000 tokens. The cost shown is an estimate based on current published pricing. Input and output tokens are often priced differently — output (completion) tokens usually cost 2-3x more than input tokens.
Is my text sent to any AI model or server? +
No. Token counting is done entirely in your browser using JavaScript. Your text is never sent to any AI model, API, or server.


Tam Rehber: Token Sayacı

GPT-4 ve Claude gibi büyük dil modelleri (LLM'ler) metni karakter karakter veya kelime kelime değil, token adı verilen parçalar halinde işler. Token sayınızı önceden bilmek para tasarrufu sağlar, bağlam taşması hatalarını önler ve prompt optimizasyonuna yardımcı olur.

Token Nedir?

Token, Byte-Pair Encoding (BPE) tokenizörünün ürettiği bir metin birimidir. BPE, tek tek karakterlerle başlar ve hedef sözcük dağarcığı boyutuna ulaşana kadar en sık bitişik çiftleri birleştirir. Pratik kural: 1 token ≈ 4 karakter veya İngilizce düzyazıda yaklaşık 0,75 kelime.

Bağlam Penceresi Sınırları

Bağlam sınırını aşmak API hatasına neden olur. Sohbet uygulamalarında eski mesajları özetlemeniz veya kırpmanız gerekir.

Token Sayısı Neden Maliyeti Etkiler?

Tüm büyük LLM API'leri, giriş token'ları (prompt) ve çıkış token'ları (modelin yanıtı) için ayrı ücretlerle token başına ücret alır. Çıkış token'ları genellikle giriş token'larından 3-5 kat daha pahalıdır.

Prompt Optimizasyon İpuçları

Ham kelime ve karakter sayısı için Kelime Sayacı'nı, büyük JSON yüklerini biçimlendirmek için JSON Biçimlendirici'yi kullanın.

🧰 50+ Tools