---
title: "Token Counter: Count LLM tokens for ChatGPT, Claude, and Gemini | Keep"
description: "Count the tokens in any text or webpage. Pick a model, see how much of its context window you fill, and compare the HTML cost of a page against the Markdown version. Free, no sign-up."
canonical: "https://keep.md/tools/token-counter"
language: "en"
---

# Token counter

Count tokens in text you paste or in any public webpage. Pick a model to see how much of its context window the text fills.

## How to use this tool

Paste text and pick a model to count its tokens in your browser. Switch to the URL tab to compare the raw HTML cost of a page against its Markdown version.

## Keep anything useful as Markdown.

Save notes, links, pages, files, and other useful material as clean Markdown. Read it later, search it, or use it with an AI agent.

[Start for free](https://app.keep.md/signup)

[Read the docs](https://keep.md/docs)

## How to count tokens in text

1.  Paste your text into the box above.
2.  Pick the model you are about to send it to. The count updates as you type.
3.  Read the context bar to see how much of that model's window the text would fill.

The tokenizer runs in your browser. Prompts, private notes, and internal docs never leave the page.

## How to count the tokens in a URL

1.  Switch to the URL tab and paste the address.
2.  Keep fetches the page twice. Once with Accept: text/html to see what an LLM crawling the raw site pays for. Once with Accept: text/markdown to see whether the site serves Markdown natively.
3.  Compare the two columns. The headline number is how many tokens go away when the same content is served as Markdown instead of HTML.

## Why token counts matter

Every token you send is billed and takes room in the context window. A long CLAUDE.md, a pasted transcript, or an HTML page full of nav menus and tracking scripts all eat the same budget the model needs for your actual question. Measuring before you send is the cheapest way to find out what is crowding out the work.

## Which tokenizer the tool uses

The o200k\_base encoding that OpenAI publishes and every current GPT-5 series model uses, from GPT-5.2 through the GPT-5.6 family. For OpenAI models the count is exact and matches the OpenAI Tokenizer playground.

## Claude and Gemini token counts are estimates

Anthropic does not publish a tokenizer for current Claude models, and Google does not ship one for Gemini, so no browser tool can give you an exact count for either. Pick Claude or Gemini and the tool shows the o200k\_base count with an estimate label. That number usually lands within 10 to 15 percent of the real one on English prose, which is close enough to plan a context budget. When you need the exact figure, Anthropic's Messages API has a free count\_tokens endpoint and Google's API has a countTokens method.

## Frequently asked questions

Paste the text into the box above and pick a model. The count updates as you type. The tokenizer runs in your browser, so nothing you paste is uploaded, logged, or stored. Use it for prompts, CLAUDE.md and AGENTS.md files, transcripts, or anything else you are about to hand to a model.

Switch to the URL tab, paste the address, and press Count tokens. Keep fetches the page server-side, counts tokens on the raw HTML, and counts tokens again on the Markdown version so you can see the difference. URL checks share the five daily server-tool uses. Text you paste is counted in your browser and stays unlimited.

The o200k\_base encoding that OpenAI publishes and every current GPT-5 series model uses, from GPT-5.2 through the GPT-5.6 family. For OpenAI models the count is exact and matches the OpenAI Tokenizer playground.

No, and the tool labels it as an estimate. Anthropic does not publish a tokenizer for current Claude models, so no browser tool can give you an exact Claude count. The number shown is the o200k\_base count, which usually lands within 10 to 15 percent of Claude’s own number on English prose. If you need the exact figure, Anthropic’s Messages API has a free count\_tokens endpoint that returns it for a given model.

Same situation as Claude. Google does not ship a browser tokenizer for Gemini, so the tool shows the o200k\_base count with an estimate label. Google’s countTokens API method returns the exact number if you need it.

The share of the selected model’s input context window that your text would fill. It is the fastest way to sanity-check whether a long file, a pasted transcript, or a growing CLAUDE.md is about to crowd out everything else in a session. Context windows change when vendors ship new models, so treat the bar as a guide rather than a contract.

Two things happen at once. The tool sends a second request to the same URL with Accept: text/markdown. If the site honours that header and returns real Markdown, the column is green and you see the actual tokens agents get today. If the site returns HTML anyway, the column is amber and the number is the Markdown version Keep would extract from the HTML. That is the hypothetical saving if the site added Markdown support.

HTML carries the page chrome along with the article. Scripts, style tags, nav menus, cookie banners, tracking pixels, SVG icons, inlined social share widgets. None of that is useful to an AI agent. Markdown drops all of it and keeps just the headings, paragraphs, links, and lists. On most content pages that is an 80 to 95 percent reduction.

It sees a normal server-side fetch with a regular browser user agent. Two requests per check, one for HTML, one for Markdown. Nothing identifies the request as coming from Keep. The URL you paste is not stored or tied to an account.

A page that looks short in your browser often has 50 to 100 kilobytes of inlined React, Tailwind, analytics, and CSS keyframes. The tool counts every byte the server returned. If the site is entirely client-rendered, the initial HTML may even be an empty shell and the real content arrives later via JavaScript, in which case the HTML tokens are mostly scripts.

A token is roughly three to four characters of English text. Short common words are often one token each. Rare words and code fragments can take three or more tokens. Whitespace, punctuation, and capitalisation all shift the count. The tool uses the official BPE tokenizer so the number matches what the model actually charges.

No. The text tab loads the tokenizer into the page and counts locally, so the text never touches a server. Only the URL tab makes a network request, and that request carries the URL rather than any content of yours.

A set of four conventions that let a website serve clean Markdown to AI agents instead of HTML. The dedicated Markdown for Agents checker at /tools/markdown-for-agents runs all four checks plus llms.txt and MCP discovery against any URL.

Keep is the upstream product. Every page you bookmark gets stored as clean Markdown in a searchable library, which means you get the token-efficient version without having to check each site yourself. This tool is the public lookup for one URL at a time.

The tool truncates the Markdown at roughly 10,000 characters for the preview and savings math. Very long articles are handled fine, they just show a truncated marker in the preview. The token numbers are computed on the truncated Markdown so the savings percentage is honest even when the underlying page is huge.

## Related tools

[

### Markdown for Agents checker

Paste any URL and get nine pass or fail checks for AI agent readiness. Content negotiation, .md variants, HTML and HTTP alternate links, plus llms.txt and MCP discovery.

](https://keep.md/tools/markdown-for-agents)[

### URL to Markdown

Convert any webpage into clean, AI-ready Markdown. Title, body, headings, and links preserved. Nav and ads stripped.

](https://keep.md/tools/url-to-markdown)[

### llms.txt validator

Check your llms.txt file against the spec. Paste or point at a URL to get line-by-line errors, token counts, and a sibling llms-full.txt report.

](https://keep.md/tools/llms-txt-validator)[

### Twitter RSS feed generator

Turn any public X profile into an RSS feed with posts, articles, or both, then copy the URL into your feed reader.

](https://keep.md/tools/twitter-rss-feed)
