All tools

LLM Token Counter

Estimate tokens, API cost and context window usage for GPT-4, Claude, Llama and Gemini.

Browser onlyYour input is processed in this browser and is not sent to SpeedyTools servers.
Share:
Input Text

0 characters

0

Characters

0

Words

0

Sentences

0

Paragraphs

Token Estimates by Model

GPT-4o

OpenAI

~0

tokens

GPT-4o-mini

OpenAI

~0

tokens

GPT-4o (Jan 2025)

OpenAI

~0

tokens

o1

OpenAI

~0

tokens

o1-mini

OpenAI

~0

tokens

o3-mini

OpenAI

~0

tokens

GPT-4 / GPT-4 Turbo

OpenAI

~0

tokens

GPT-3.5 Turbo

OpenAI

~0

tokens

Claude 3.5 Sonnet

Anthropic

~0

tokens

Claude 3.5 Haiku

Anthropic

~0

tokens

Claude 3 Sonnet

Anthropic

~0

tokens

Claude 3 Haiku

Anthropic

~0

tokens

Claude 4 Opus

Anthropic

~0

tokens

Claude 4 Sonnet

Anthropic

~0

tokens

Claude 3 Opus

Anthropic

~0

tokens

Gemini 2.0 Flash

Google

~0

tokens

Gemini 2.0 Pro

Google

~0

tokens

Gemini 1.5 Pro

Google

~0

tokens

Gemini 1.5 Flash

Google

~0

tokens

Llama 3.2

Meta

~0

tokens

Llama 3.1 (405B)

Meta

~0

tokens

Llama 3 (70B)

Meta

~0

tokens

Mistral Large

Mistral

~0

tokens

Mistral Small

Mistral

~0

tokens

Grok 2

xAI

~0

tokens

Grok 2 Vision

xAI

~0

tokens

Command R+

Cohere

~0

tokens

Command R

Cohere

~0

tokens

Cost Calculator

Estimated Input Cost

$0.0000

Estimated Output Cost

$0.0000

Costs are estimates based on approximate token counts. Actual costs may vary depending on the tokenizer used by each provider.

Context Window Usage
GPT-4o0 / 128.0K tokens

0.0% of context window used

About LLM token counting

Large language models read and bill text in tokens. The token count decides what a request costs and whether it fits in the model's context window.

Each provider uses its own tokenizer, so the same text gives different counts on different models. This tool estimates counts from a characters-per-token ratio for each model, so you don't need to install any tokenizer libraries. The numbers are approximate.

Features
Token estimates update as you type
Estimates for 30 LLM models
Editable pricing for custom cost estimates
Context window usage bar
Character, word, sentence and paragraph counts
Copy all statistics to clipboard
Compare token counts across all models
Runs in your browser, nothing sent to a server
Common use cases

API cost estimation

Estimate what your prompts and completions will cost with different LLM providers

Prompt engineering

Trim prompts to stay within token limits

Context window planning

Check that your input fits a model's context limit before you call the API

Model selection

Compare token counts and cost across models to find the cheapest one for your use case

Frequently asked questions

What is a token in the context of LLMs?

A token is the unit of text a language model reads. A token can be a word, part of a word or a single character. In English, one token is roughly 4 characters or about 0.75 words. Tokenization varies by model.

How accurate are the token estimates?

They are approximations. The tool divides the character count by a fixed characters-per-token ratio for each model instead of running the real tokenizer. Code and non-English text are the most likely to differ from the actual count. Use the provider's own tokenizer when you need an exact number.

Why do different models have different token counts?

Each provider has its own tokenizer and vocabulary. OpenAI uses tiktoken, and Anthropic, Google and others have their own. Each tokenizer splits text differently, so the same text gives different counts.

How are API costs calculated?

Cost is the token count multiplied by the price per 1,000 tokens. Most providers charge different rates for input tokens (your prompt) and output tokens (the model's response), so the tool shows both. You can edit the prices to match your provider's current rates.

What is a context window and why does it matter?

A context window is the maximum number of tokens a model can handle in one request, counting input and output together. GPT-4 Turbo, for example, has a 128K token context window. If your input is larger than the window, the API returns an error.

Private by default

The tool counts tokens and estimates cost in your browser and sends nothing to a server.