Home › Text Tools › AI Token Counter

AI Token Counter

Paste a prompt or document to count its tokens exactly with OpenAI's tokenizers (o200k_base for GPT-4o and newer, cl100k_base for GPT-4). Every token is highlighted so you can see how the model splits your text, and the cost box turns the count into an input price estimate.

Last updated:

Token boundaries

Loading tokenizer…

Advertisement
Advertisement

How to use the AI Token Counter

  1. Paste your text into the box, or open a .txt, .md, .json or code file.
  2. Pick the tokenizer that matches your model: o200k_base for GPT-4o and newer OpenAI models, cl100k_base for GPT-4 and GPT-3.5 Turbo.
  3. Read the count in the green box. It updates as you type.
  4. Inspect the tokens in the colored view below; turn on token IDs to see the numbers the model receives.
  5. Estimate cost: choose a price preset or type your provider's current price per 1M input tokens and the number of requests.

Typical token counts

These rules of thumb come from OpenAI's guidance for English text with its tokenizers. Real counts depend on the text, so use the counter above for anything that matters.

Amount of English textApproximate tokens
1 token≈ 4 characters, or ¾ of a word
100 tokens≈ 75 words
1 paragraph≈ 100 tokens
1,500 words≈ 2,048 tokens

OpenAI encodings at a glance

EncodingVocabulary sizeUsed by
o200k_base≈ 200,000 tokensGPT-4o, GPT-4o mini, GPT-4.1 family, o1 / o3 / o4-mini
cl100k_base≈ 100,000 tokensGPT-4, GPT-4 Turbo, GPT-3.5 Turbo, text-embedding-3-small/large, text-embedding-ada-002
p50k_base≈ 50,000 tokensCodex models, text-davinci-002 and -003
r50k_base≈ 50,000 tokensOriginal GPT-3 models (davinci, curie, babbage, ada)

A larger vocabulary usually means fewer tokens for the same text, especially for code and non-English languages, which is why the same prompt is often cheaper to send to GPT-4o than to GPT-4.

Tips to reduce token usage

  • Trim boilerplate: long system prompts are sent with every request, so a 1,000-token prompt across 10,000 requests is 10 million input tokens.
  • Prefer compact formats: minified JSON, CSV or short keys use fewer tokens than pretty-printed JSON with long field names.
  • Watch whitespace: indentation and repeated blank lines become tokens too; turn on "Show spaces and line breaks" to spot them.
  • Summarize history: in long chats, replace old turns with a short summary instead of resending the full conversation.
  • Use cached prompts: many providers discount repeated prompt prefixes; put the stable part of your prompt first.

Frequently asked questions

What is a token?

A token is the unit of text a language model reads and writes. Tokenizers split text into common chunks: frequent English words are often a single token (including the space before them), while rare words, numbers, code and many non-English scripts are split into several tokens. In English, one token averages roughly four characters, but this varies a lot by text.

Which tokenizer should I choose?

OpenAI's GPT-4o, GPT-4o mini, GPT-4.1 and o-series reasoning models use o200k_base. GPT-4, GPT-3.5 Turbo and the text-embedding-3 models use cl100k_base. p50k_base and r50k_base are for older Codex and GPT-3 models.

Can I count tokens for Claude, Gemini or Llama?

Those models use their own tokenizers, so counts here are an approximation for them. Anthropic does not publish a downloadable tokenizer for current Claude models; for exact numbers use the provider's token counting endpoint or the usage figures returned with each API response.

Why is the API bill higher than the count here?

This page counts only the text you paste. A chat request also includes the system prompt, message formatting tokens, tool definitions and images, and you are billed separately for output tokens (and reasoning tokens on reasoning models), which are usually priced higher than input.

How is the cost estimate calculated?

Cost = tokens ÷ 1,000,000 × price per 1M input tokens × number of requests. Presets reflect public list prices for standard input tokens as of mid-2025; batch discounts, cached-input rates and price changes are not included, so edit the price to match your plan.

Is my text sent to OpenAI or anyone else?

No. The tokenizer runs entirely in your browser. Only the tokenizer files are downloaded from a public CDN the first time; your text stays on your device.

Why do Chinese, Japanese or emoji use so many tokens?

Byte-pair tokenizers were trained mostly on English text, so characters from other scripts are less often merged into large tokens. A single Chinese character can be one or two tokens and an emoji can take several, because the tokenizer works on UTF-8 bytes.

Are all the tools on FreeToolCabin tested for quality and accuracy?

Yes! Every tool on our site undergoes automated Q/A testing in real browser environments to ensure high precision, correct output, and zero errors. If you happen to spot a bug or have a suggestion, please contact us at [email protected] and our team will review it right away.

Related tools

AI Prompt GeneratorBuild better prompts for ChatGPT, Midjourney and more.Word CounterCount words and characters and clean up text.Character CounterCount characters with and without spaces, words, lines and bytes, with live limit bars.LLMs.txt GeneratorBuild an llms.txt file for AI crawlers: summary and link sections, import from your sitemap.Grammar CheckerCheck grammar, spelling and punctuation with clickable suggestions and one-click fixes.Word Count to PagesHow many pages is 1,000 words? Estimate pages by font, size, spacing and margins.X Post Character CounterCount X (Twitter) post characters and split long text into a thread.YouTube Title Length CheckerCheck YouTube title length, preview truncation and score it for clicks.Text CompareFind the differences between two texts.Word Frequency CounterFind the most used words and phrases in any text and turn them into a word cloud.Sentence CounterCount sentences and paragraphs, see average sentence length and spot long sentences.Readability CheckerScore your text with Flesch, Flesch-Kincaid, Gunning Fog, SMOG and more readability tests.Keyword Density CheckerFind the most used 1, 2 and 3-word phrases in your text and their keyword density %.Reading Time CalculatorEstimate how long a text takes to read or speak at any speed, and copy a “5 min read” badge.Palindrome CheckerCheck if a word, sentence or number is a palindrome and find the longest palindrome in text.Syllable CounterCount syllables per word, line and total, and check haiku 5-7-5 instantly.Text SummarizerSummarize long text into its key sentences and keywords, privately in your browser.Spell CheckerCheck spelling online: misspelled words are highlighted with suggestions you can click to fix.DictionaryLook up English word definitions with pronunciation audio, examples, synonyms and antonyms.Letter Frequency CounterCount how often each letter appears, compare with English frequencies and see top bigrams.Antonym FinderFind opposites of any word: direct antonyms, near antonyms and definitions, click to copy.British to American Spelling ConverterConvert UK spelling to US spelling and back (colour/color, organise/organize) with highlights.Homophone FinderLook up homophones like there/their/they're with definitions and examples from 400+ sets.N-Gram GeneratorGenerate word or character n-grams (1-5) with frequency counts, stopword filter and CSV export.Passive Voice CheckerHighlight passive voice in your writing, see the passive sentence %, and get active rewrites.Periodic Table Word SpellerSpell words and names with chemical element symbols and download them as element tiles.Related Words FinderFind words related to any word or topic: associations, describing adjectives and more.Synonym FinderFind synonyms grouped by relevance, filter by syllables or first letter and click to copy.Text Similarity CheckerCompare two texts for similarity with cosine, Jaccard and Levenshtein scores and shared phrases.Words That Start With FinderFind words that start with, end with or contain any letters, filtered by length.Elevator Pitch GeneratorBuild 10, 30 and 60-second elevator pitches with word counts and speaking time.Abbreviation FinderLook up what common abbreviations and acronyms stand for, or find the abbreviation for a phrase.Describing Words FinderEnter a noun and get adjectives that commonly describe it, sorted by how often they are used.Keyword ExtractorPull the top keywords and key phrases from any text with RAKE or TF-IDF scores.Line CounterCount total, non-empty, blank and unique lines in text or a .txt file, with line length stats.Paragraph CounterCount paragraphs in any text, with words and sentences per paragraph and the longest and shortest.Resume Keyword ScannerCompare your resume to a job description: match score, missing skills and keyword counts.Scrabble Word CheckerCheck if a word is playable, see its Scrabble score, hooks, anagrams and two-letter word meanings.Food Allergen CheckerPaste an ingredient list to highlight the 9 major food allergens and their hidden names.GC Content CalculatorDNA/RNA GC %, AT %, base counts, GC skew and a sliding-window GC plot from any sequence or FASTA.Google Ads Character CounterWrite responsive search ads with live 30/90/15 counters, pins, keyword insertion checks and a preview.ORF FinderFind open reading frames in all 6 frames of a DNA sequence, with positions, lengths and protein translations.Podcast Intro Script GeneratorWrite podcast intro and outro scripts in five tones, with sponsor, call to action and read time.Restriction Enzyme FinderFind cut sites for 180+ restriction enzymes in DNA, with fragment sizes, a site map and a virtual gel.SAT Vocabulary Flashcards363 high-frequency SAT words with definitions and examples: flip cards, quizzes and saved progress.Text HighlighterHighlight chosen words and phrases in several colors, count each one and copy the colored text.Sentiment AnalyzerScore the sentiment of reviews and messages per sentence, with positive and negative words.SMS Character CounterCount SMS characters and segments, detect GSM-7 vs Unicode and find the characters that cost extra.Social Media Character CounterCheck one post against X, Instagram, TikTok, LinkedIn, YouTube and more limits at once.Spelling Bee SolverEnter the 7 honeycomb letters to get every word, pangrams highlighted, points and a hint grid.Spelling PracticeType your weekly spelling words, hear each one read aloud, spell it and retry the misses.Spelling Test GeneratorTurn a word list into a spoken, auto-graded spelling test or a printable test with answer key.Transition Words FinderFind transition words by category with examples, and check the transitions in your essay.Writing Style AnalyzerHighlight hard sentences, adverbs, passive voice and complex words, with a grade level.
See all 53 Text Counters & Analyzers →