Token Counter

This token counter shows how many tokens your text uses and what it costs to send to an AI model. The count is exact for OpenAI models that use the o200k_base encoding, and it is an estimate for other models. Your text is processed in your browser and is never uploaded.

Loading the tokenizer

Tokens0o200k_base encoding (GPT-4o, GPT-4.1, GPT-5, o-series)
Characters0
Words0
Characters per token-

Cost and context for a model

Cost as input$0.00
Cost as output$0.00
Monthly cost as input$0.00

Prices read from OpenRouter's public model list on December 4, 2026.

This is an estimate, not a quote. Taxes, credits, discounts and custom contracts are not included, and the provider's own pricing page always takes precedence.

How the text splits into tokens

Your tokens appear here, one colour per token.

How to use the token counter

Paste or type your text into the box. The token counter updates as you type and shows the number of tokens, characters and words. It also shows the average number of characters per token, which tells you how efficiently the text is encoded.

Then pick a model from the list. The tool multiplies the token count by the price of that model, so you see the cost of sending the text as input and of receiving it as output. In addition, a bar shows how much of the context window the text fills. Finally, the coloured view at the bottom shows exactly where one token ends and the next begins.

Who uses a token counter

Developers use a token counter to check that a prompt fits the context window before they send it. Prompt writers use it to trim a long system prompt, because every token is billed on every request. Product owners use it to estimate what a feature will cost each month. Students and writers use it to understand why a model stopped in the middle of an answer.

What a token is

Token Counter

A token is a piece of text that a language model handles as one unit. It can be a whole word, part of a word, a punctuation mark or a space. In English, one token is about four characters on average, so 100 tokens are roughly 75 words.

Models do not read letters. Instead, a tokenizer first turns the text into a list of numbers, and each number stands for one token. For that reason, the limits and prices of a model are counted in tokens and not in words or characters.

However, other languages behave differently. Text in Chinese, Japanese, Korean or Arabic often needs more tokens for the same meaning. Code, tables and unusual names also split into many small pieces.

How accurate this token counter is

The count is exact for the o200k_base encoding. The open-source tiktoken library from OpenAI lists this encoding for GPT-4o, GPT-4.1, GPT-5 and the o-series models. So the number matches what those models count for plain text.

Other providers use their own tokenizers. Therefore the count for Claude, Gemini, Grok, DeepSeek and other models is an estimate, and the tool says so under the result. The real figure is usually close, but it can be noticeably higher or lower.

In addition, a chat request carries a few extra tokens for the message format, and tool definitions and images are counted separately. If you need the billed number, read the usage figures that the provider returns with each API response.

How to use fewer tokens

Start with the system prompt, because it is sent with every request. Remove repeated instructions, long examples and text the model does not need. A shorter prompt is cheaper, and it often gives clearer answers too.

Next, limit the output. Output tokens cost several times more than input tokens with most models, so ask for a short answer or set a lower output limit. Also send only the part of a document that the question needs.

Finally, cache what repeats. Several providers bill a repeated prompt prefix at a lower rate. If the same long context is sent many times, caching can cut the input cost sharply.

Privacy and limits of the token counter

The token counter runs in your browser. Your text is not sent to our servers or to any model provider, so you can paste confidential prompts. The tokenizer itself is a small open-source library that the page downloads once.

To keep the page responsive, only the first 500,000 characters are counted, and the coloured view shows the first 1,500 tokens. If the library cannot be loaded, the tool falls back to an estimate of four characters per token and tells you.

The prices come from a public model list that is read each time this site is rebuilt. They are list prices, so treat every cost as an estimate and check the pricing page of the provider before you commit a budget.

Need a tool like this built for your business?

We build fast, private web tools and apps that run in the browser. That includes calculators, booking widgets and internal dashboards.

Talk to us about a web tool

Frequently Asked Questions

Is this token counter free?

Yes. The token counter is free, needs no account and has no usage limit. It runs in your browser, so there is nothing to install.

Is my text uploaded when I use the token counter?

No. The counting happens on your device. Your text never leaves the page, which makes the tool safe for private or confidential prompts.

Which models does the token counter support exactly?

The count is exact for OpenAI models that use the o200k_base encoding, such as GPT-4o, GPT-4.1, GPT-5 and the o-series. For every other model the tool shows an estimate and labels it clearly.

How many tokens is 1,000 words?

In English, 1,000 words are about 1,300 to 1,400 tokens. The exact number depends on the words, so paste the text to see the real count.

Why does the same text have a different token count in another model?

Each provider trains its own tokenizer, and each one splits text differently. As a result, the same sentence can be 20 tokens in one model and 24 in another.

More questions about counting tokens

How do I count tokens for Claude or Gemini?

This tool gives an estimate for those models. For the exact number, use the token counting endpoint of the provider or read the usage figures in the API response.

Do spaces and punctuation count as tokens?

Yes. A space is usually joined to the word that follows it, while punctuation marks and line breaks often become tokens of their own.

What is a context window?

It is the largest number of tokens a model can handle in one request, counting your input and its answer together. The bar under the cost shows how much of it your text uses.

Why are output tokens more expensive?

Writing text takes more computing work than reading it, because the model produces one token at a time. Therefore most providers charge several times more for output.

Can I count tokens in code or JSON?

Yes. Paste code, JSON or Markdown like any other text. Keep in mind that brackets, quotes and indentation all use tokens, so structured data is often longer than it looks.

A PROJECT STARTS WITH A CONVERSATION

Tell us what
you have in mind.

Share the outcome you need, your existing systems and any constraints. You don't need a technical specification to start.

If the form does not work, email us directly at contact@mecanik.dev

Direct engineering support

Direct technical collaboration.
A clear scope and accountable delivery.