Skip to main content
SaaSCity.io
DirectoriesLive LaunchesBlogWrite for UsAdvertise
Submit
HomeFree toolsAI token counter

Free tool

Token counter for GPT, Claude, Gemini and Llama

Paste text or drop a file to count characters, words and tokens. Exact counts with OpenAI’s tokenizers, labelled estimates for Claude, Gemini and open models, and the input cost on every model we price.

Updated October 27, 2026

Your text

Drop a .txt, .md, .json or .csv file here, up to 5 MB.

Runs in your browser. Nothing you type or upload leaves your device.

Tokens (o200k_base, GPT-5 and GPT-4o)

…

Loading the tokenizer…

Characters
385
Words
62
cl100k_base (GPT-4, GPT-3.5)
…

Other models

  • Claude o200k × 1.35, current tokenizerEstimate…
  • Gemini about the o200k countEstimate…
  • Llama 3 about the cl100k countEstimate…
  • Qwen cl100k, digits splitEstimate…
  • DeepSeek o200k × 1.2Estimate…
  • Mistral rough: the o200k countEstimate…

Estimates follow each provider’s published figures; the method for each is under “How the estimates work” below.

How the text splits into tokens

Loading the tokenizer…

First 400 tokens in o200k_base. Each colour is one token.

What this text costs as input

Input price × tokens, at prices verified on October 27, 2026. ≈ marks an estimated count.

ModelTokensInput costFits context
Claude Fable 5.1Anthropic………
Claude Opus 5.5Anthropic………
Claude Sonnet 5.5Anthropic………
Claude Haiku 5.5Anthropic………
Claude Opus 5Anthropic………
Claude Sonnet 5Anthropic………
Claude Sonnet 4.6Anthropic………
Claude Haiku 4.5Anthropic………
GPT-6 AstraOpenAI………
GPT-6.1 SolOpenAI………
GPT-6.1 TerraOpenAI………
GPT-6 LunaOpenAI………
GPT-5.5OpenAI………
GPT-5.4 miniOpenAI………
GPT-5 miniOpenAI………
GPT-5 nanoOpenAI………
Gemini 4 ArgonGoogle………
Gemini 3.8 FlashGoogle………
Gemini 3.5 Flash-LiteGoogle………
Gemini 3.1 Flash-LiteGoogle………
Gemini 3.1 Pro PreviewGoogle………
Gemini 2.5 ProGoogle………
Gemini 2.5 FlashGoogle………
Gemini 2.5 Flash-LiteGoogle………
Grok 4.7xAI………
Grok 4.3xAI………
Grok Build 0.1xAI………
DeepSeek V4.1 FlashDeepSeek………
DeepSeek V4 ProDeepSeek………
Mistral Large 4Mistral………
Mistral Medium 3.5Mistral………
Mistral Large 3Mistral………
Mistral Small 4Mistral………

Quick answer

How do you count tokens?

A token counter splits text the way a model’s tokenizer does and counts the pieces. OpenAI’s GPT-5, GPT-4.1, GPT-4o and o-series models use the o200k_base tokenizer, and OpenAI’s rule of thumb is 1 token ≈ 4 characters or 0.75 words of English. Example: “Tokens are pieces of words.” is 6 tokens: Tokens, are, pieces, of, words and the full stop.

How to use the token counter

  1. Add your text

    Paste text into the box, or drop a .txt, .md, .json or .csv file of up to 5 MB. Characters and words update as you type.

  2. Read the exact counts

    o200k_base is the tokenizer of GPT-5, GPT-4.1, GPT-4o and the o-series; cl100k_base is GPT-4 and GPT-3.5 Turbo.

  3. Compare other models

    Claude, Gemini, Llama, Qwen, DeepSeek and Mistral get estimates, each labelled with how it is made.

  4. Check cost and fit

    The cost panel prices the text as input on every model and shows whether it fits the context window.

How the counts are made

The OpenAI counts are exact: the page runs the open-source gpt-tokenizer library, a JavaScript port of OpenAI’s tiktoken encodings, in your browser. Special-token strings such as <|endoftext|> are counted as ordinary text, the way they are in a normal prompt. Long texts are counted in chunks split at line breaks, which gives the same total as counting in one go without freezing the page.

No exact tokenizer for current Claude, Gemini or Grok models runs in a browser, so those counts are estimates anchored on the exact count and scaled by each provider’s own published figures. Llama and Qwen built their vocabularies on top of cl100k_base, so their estimates start from that count. For exact Claude or Gemini numbers, use the token counting endpoint in Anthropic’s or Google’s API with the model ID.

Characters are Unicode characters, so an emoji counts once. Words are runs of characters between spaces or line breaks. Message formatting in a chat request (roles, tool definitions) adds tokens this text count does not include.

Formula
Exact: tokens = length of encode(text) with o200k_base or cl100k_base Claude ≈ o200k × 0.75 ÷ 0.555 (≈ 1.35) Gemini ≈ o200k × 4 ÷ 4 DeepSeek ≈ o200k × 4 × 0.3 (= 1.2) Llama 3 ≈ cl100k Qwen ≈ cl100k + extra tokens for split digits Input cost = tokens × input price per 1M ÷ 1,000,000

Worked example

  1. The sample text in the box: 385 characters and 62 words.
  2. o200k_base: 77 tokens, so 385 ÷ 77 = 5.0 characters per token and 62 ÷ 77 × 100 ≈ 81 words per 100 tokens.
  3. cl100k_base: also 77 tokens for this text.
  4. Claude estimate: 77 × 0.75 ÷ 0.555 = 104 tokens.
  5. Input cost on GPT-5.5 at $5 per 1M tokens: 77 × $5 ÷ 1,000,000 = $0.000385.

Tokens to words, and words to tokens

There is no single conversion: it depends on the tokenizer and the text. These are the providers’ own rules of thumb for English, averaged over many texts, so count the real text when it matters.

Tokenizer1 token is about1,000 English wordsSource
OpenAI (o200k_base, cl100k_base)4 characters or 0.75 words≈ 1,333 tokensOpenAI docs
Claude, current (Opus 4.7 and later)0.555 words (1M tokens ≈ 555,000 words)≈ 1,802 tokensAnthropic docs
Claude, previous (Sonnet 4.6, Haiku 4.5)0.75 words (1M tokens ≈ 750,000 words)≈ 1,333 tokensAnthropic docs
Gemini4 characters (100 tokens ≈ 60–80 words)≈ 1,250–1,667 tokensGoogle docs
Llama 33.94 charactersNot statedMeta, Llama 3 paper
Qwen3–4 characters (Chinese: 1.5–1.8)Not statedQwen docs
DeepSeek3.3 characters (0.3 tokens per character; Chinese 0.6)Not statedDeepSeek docs

Which models use o200k_base and cl100k_base

OpenAI’s tiktoken library maps every model to its encoding. o200k_base has a vocabulary of about 200,000 tokens and cl100k_base about 100,000. OpenAI has not published the tokenizer of its GPT-6 models, so for GPT-6 the o200k_base count is shown as an estimate.

EncodingModels
o200k_baseGPT-5 family (GPT-5, 5.1, 5.2, 5.4, 5.5, 5.6 and their mini, nano and pro versions), GPT-4.5, GPT-4.1, GPT-4o, o1, o3, o4-mini
cl100k_baseGPT-4, GPT-4 Turbo, GPT-3.5 Turbo, text-embedding-3-small, text-embedding-3-large, text-embedding-ada-002

How the estimates work

Model familyEstimateBased on
Claude (Opus 4.7 and later, all Claude 5)o200k × 1.35OpenAI: 0.75 words per token. Anthropic: 555,000 words per 1M tokens on the current tokenizer, about 30% more tokens than before. 0.75 ÷ 0.555 ≈ 1.35.
Claude (Sonnet 4.6, Haiku 4.5)o200k × 1Anthropic: about 750,000 words per 1M tokens, the same as OpenAI’s 0.75 words per token.
Geminio200k × 1Google and OpenAI both put a token at about 4 characters of English.
DeepSeeko200k × 1.2DeepSeek: 1 English character ≈ 0.3 tokens, against OpenAI’s 4 characters per token.
Llama 3cl100kMeta built Llama 3’s vocabulary from 100,000 tiktoken tokens plus 28,000 for other languages, with no impact on English.
Qwencl100k + split digitsQwen started from cl100k_base and gives every digit its own token; Qwen3 uses the same tokenizer. Chinese text needs fewer tokens than this.
Mistral, Grok, GPT-6o200k × 1No tokenizer or ratio published. A rough stand-in only.

Token counter questions

How many tokens is 1,000 words?
About 1,333 tokens on OpenAI’s tokenizers by OpenAI’s rule of thumb (0.75 words per token), about 1,800 on Claude’s current tokenizer, and 1,250 to 1,667 on Gemini by Google’s figures. Paste your text for an exact OpenAI count.
What is the OpenAI tokenizer?
It is the byte-pair encoding that splits text into tokens for OpenAI’s models. GPT-5, GPT-4.1, GPT-4o and the o-series use o200k_base; GPT-4 and GPT-3.5 Turbo use cl100k_base. This page runs both in your browser.
How do I count tokens for Claude?
Anthropic has no browser tokenizer for current Claude models, so this page estimates from its published figures: about 1.35 times the o200k count. For an exact count, use the token counting endpoint of Anthropic’s API with the model ID.
How many characters is a token?
In English, about 4 by OpenAI’s and Google’s rules of thumb, and about 2.5 on Claude’s current tokenizer by Anthropic’s figure. The counter shows the exact characters per token of your own text.
Do spaces and line breaks count as tokens?
Yes. Whitespace is part of the text and is tokenized like everything else, usually merged into the next word or into runs of spaces. Minifying JSON or removing indentation lowers the count.
Why are the Claude and Gemini counts estimates?
No exact tokenizer for current Claude or Gemini models runs in a browser, so the page scales the exact OpenAI count by each provider’s published figures. Their APIs’ token counting endpoints give exact numbers.
How much does it cost to send this text to a model?
Multiply the tokens by the model’s input price per million and divide by 1,000,000: 10,000 tokens on GPT-6.1 Sol at $2 per 1M cost $0.02. The cost panel does this for every model we price.
Is my text uploaded anywhere?
No. The text and any file you drop are read and tokenized in your browser. Nothing is sent to SaaSCity or any other server.
What is the largest file I can check?
Files up to 5 MB in .txt, .md, .json or .csv format. Larger files and other formats are turned away before they are read.

Related

  • LLM API pricing calculator
  • Launch copy character counter
  • Claude Haiku 5.5 and AI SaaS margins
  • Claude Code pricing: what it costs

Cite this tool

Free to link and quote. Use this reference:

SaaSCity, "AI Token Counter", October 27, 2026. https://saascity.io/free-tools/token-counter

Sources

  • OpenAI, Key concepts: tokens (rule of thumb)
  • OpenAI, tiktoken model-to-encoding map
  • gpt-tokenizer (MIT), the library this page runs
  • Anthropic, Models overview (words and characters per 1M tokens)
  • Anthropic, Pricing (current tokenizer, about 30% more tokens)
  • Google, Understand and count tokens
  • Meta, The Llama 3 Herd of Models (2024)
  • Qwen Technical Report (2023)
  • Qwen3 Technical Report (2025)
  • Qwen docs, Key concepts
  • DeepSeek, Token & token usage
  • OpenAI, API pricing (prices)
  • Google, Gemini Developer API pricing (prices)
  • xAI, Grok API pricing (prices)
  • DeepSeek, Models & Pricing (prices)
  • Mistral, API pricing (prices)

More free tools

  • LLM API pricing calculatorAPI prices for every major model and your monthly cost, with caching and batch.
  • Uptime & SLA calculatorDowntime per day, month and year for any SLA, and the uptime of your whole stack.
  • Burn rate & runway calculatorMonths of cash left, the date it runs out, when to raise, and whether you are default alive.
  • LTV calculatorCustomer lifetime value, CAC, the LTV to CAC ratio and the months it takes to earn back a customer.
  • Stripe fee calculatorWhat Stripe, Paddle, Lemon Squeezy and Polar take from each sale, side by side.
  • Domain Rating checkerAny site’s Ahrefs DR in one click, live, with no account.
  • DR badge generatorAn embeddable badge that shows your live Domain Rating.
  • Launch card generatorA shareable card image for your launch post on X and LinkedIn.
All free tools

List your AI product

If your product runs on one of these models, list it on SaaSCity: a hand-reviewed listing, a launch week and a permanent page on a DR 70 domain.

Submit your product
SaaSCity.io

Directories are boring. We built a city instead. First isometric SaaS directory on the planet.

Platform
Submit SaaSLive LaunchesPricingBlogWrite for UsMCP for AgentsAdvertiseAboutghosty
Directories
Best SaaS DirectoriesBest AI DirectoriesDirectory ReviewsBest Indie Hacker CommunitiesBest Subreddits for FoundersHow to Get SaaS BacklinksSEO GlossaryHow to Submit to DirectoriesDirectory Submission ServiceDirectory Submission Services Compared
SaaSCity Alternatives
All ComparisonsSaaSCity vs Nick LaunchesSaaSCity vs BetterLaunchSaaSCity vs PeerPushProduct Hunt AlternativesSaaSHub Alternatives
Legal
Terms of ServicePrivacy PolicyRefund PolicyCookie PolicyCopyright & DMCASecurityContact
Free Tools
ARR calculatorSaaS valuationChurn calculatorMargin calculatorTAM SAM SOMLLM API pricingDR checkerRobots.txt generatorPNG to ICOAll 35 tools →

© 2026 SaaSCity.io

llms.txt