Skip to content
| Marketplace
Sign in
Visual Studio Code>AI>LLM Tokens: Token Counter for GPT, Claude, GeminiNew to Visual Studio Code? Get it now.
LLM Tokens: Token Counter for GPT, Claude, Gemini

LLM Tokens: Token Counter for GPT, Claude, Gemini

Hamperpick

|
1 install
| (0) | Free
Count tokens for GPT, Claude, Gemini, Grok, DeepSeek, Kimi and Qwen at once, with the share of each context window. Exact where the maker publishes its tokenizer, with every estimate marked. Runs on your computer, no API key, no network.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

LLM Tokens: token counter for GPT, Claude, Gemini and embedding models

LLM Tokens shows how many tokens your open file or selection is for the current models of OpenAI, Anthropic, Google, xAI, DeepSeek, Kimi and Qwen, all at once. Next to each count it shows how much of the model's context window the text fills. Embedding models from OpenAI, Google and Voyage AI get their own table: tokens, and whether the text fits in one input. It counts on your computer, needs no API key and makes no network requests.

The LLM Tokens hover in VS Code: token counts and context window share for every current model

How do I use it?

Install it and open a file. The status bar shows the count for your main model, such as ≈1.3k–2.2k · Opus 5.5 (a range, because Anthropic publishes no tokenizer). Select text to count only the selection.

Selecting code in VS Code: the status bar count changes from the whole file to the selection

  • Hover the count for a table of every model: tokens and share of the context window.
  • Click the count to see how each figure is worked out, and to pick the model the status bar shows.
  • Right-click files or folders in the Explorer and choose Count Tokens for a whole project. The report shows the total for every model, a folder tree you can open to see where the tokens are, the largest files, totals by file type, and every file it left out with the reason.

The Count Tokens report for a project: a folder tree with each folder and file's tokens and share of the total

Which token counts are exact?

A count is exact when the maker publishes the tokenizer of that model. Others are marked ≈.

Maker How it is counted
DeepSeek Exact: the tokenizer DeepSeek publishes with V4 Pro and V4.1 Flash, the models its API serves
OpenAI o200k_base, OpenAI's published tokenizer: exact for GPT-5.6. OpenAI has not published GPT-6's, so GPT-6 counts are estimates
Kimi Moonshot AI's published tokenizer: exact for Kimi K3, an estimate for other Kimi models
Qwen The tokenizer Alibaba publishes with its open Qwen3.8 models: an estimate, as Alibaba does not say its API models use the same one
Anthropic Claude No published tokenizer: a range, from OpenAI's count to 1.75 times it
Google Gemini No published tokenizer: Google's rule of about 4 characters a token
OpenAI embeddings Exact: cl100k_base, the tokenizer OpenAI's tiktoken names for text-embedding-3-small, text-embedding-3-large and ada-002
Voyage AI Exact: the tokenizer Voyage AI publishes on Hugging Face for its Voyage 3 and 4 models
xAI Grok No published tokenizer or rule: OpenAI's count, as a rough guide

By default the hover shows each maker's current models, so DeepSeek is exact there; add older models such as GPT-5.6 or Kimi K3 with llmTokens.models. Click the count in the status bar to read the basis for every model.

Does it count tokens for embedding models?

Yes. Under the chat models, the hover table lists the current embedding models from OpenAI, Google and Voyage AI. It shows the tokens and how much of the model's input limit they fill. Over 100% means the model cannot embed it in one input, so split it into chunks first. The Count Tokens report shows, for each model, how many files are over its limit.

OpenAI's embedding models (text-embedding-3-small, text-embedding-3-large) use cl100k_base, an older tokenizer than GPT's, and Voyage AI publishes its tokenizer on Hugging Face, so both counts are exact. Google publishes no tokenizer for Gemini Embedding, so its count uses Google's rule of 4 characters a token. Turn embedding models off with llmTokens.embeddingModels.show.

Will it slow my editor down?

No. Counting runs in a separate background process, never in the editor itself, on one CPU core at low priority, so the editor and your other programs come first. As you type it counts only after you pause, and never again for text it has just counted; a typical file takes a few milliseconds for every tokenizer together. The process holds about 100 MB while you work and closes itself after one idle minute, which gives that memory back. Count Tokens on a 3,300-file project took about 12 seconds and peaked at about 190 MB; a small project takes under a second. Files larger than 512 KB are not counted as you type; use Count Tokens on them instead.

Which files does Count Tokens leave out?

Files that rarely belong in a prompt: anything your .gitignore files leave out, .git and node_modules, binary files, files over 512 KB, and by default logs, lock files, minified files, source maps, snapshots and build folders such as dist/ and coverage/. The report counts what it left out by reason and lists the files (the first 200) with why each was left out. Change the list with llmTokens.countFiles.exclude, in a workspace's settings to change it for one project only.

Does it send my code anywhere?

No. LLM Tokens makes no network requests at all. The tokenizers and the model list ship inside the extension, and everything is counted on your computer. New models arrive with extension updates.

Settings

Setting Default What it does
llmTokens.mainModel claude-opus-5-5 The model whose count shows in the status bar
llmTokens.models all current The models in the hover table and reports, by id
llmTokens.embeddingModels.show true Show embedding models under the chat models
llmTokens.statusBar.show true Show the count in the status bar
llmTokens.statusBar.maxFileSizeKB 512 Larger files and selections are not counted as you type
llmTokens.countFiles.exclude logs, lock files, build folders… Files and folders Count Tokens leaves out, in .gitignore syntax
llmTokens.countFiles.useGitignore true Leave out what the project's .gitignore files leave out
llmTokens.countFiles.maxFileSizeKB 512 Larger files are left out of Count Tokens and listed
llmTokens.countFiles.maxFiles 20000 Count Tokens stops after this many files

Questions

Why are Claude counts a range?

Anthropic does not publish the tokenizer of its current models, so no tool outside Anthropic can count Claude tokens exactly offline. LLM Tokens shows a range from OpenAI's count to 1.75 times it. Anthropic says Claude 4.7 and later produce about 30 percent more tokens than earlier models, and a test reported by The Register counted TypeScript at 1.73 times OpenAI's figure. For an exact figure, use Anthropic's token counting API.

Does the count include the system prompt or chat format?

No. It counts the text itself. A real request adds a few tokens for the message format, plus any system prompt and tools you send.

How much will my prompt cost?

LLM Tokens counts tokens only. To turn a count into a cost, multiply it by the model's input price, or use Tecyfy's price list and cost calculator.

Can I count tokens without installing anything?

Yes: the token counter on tecyfy.com counts pasted text in your browser.

Does it work in Cursor, Windsurf and VSCodium?

Yes. It is on the VS Code Marketplace and on Open VSX, and needs VS Code 1.90 or later or an editor built on it.

Is it an official OpenAI, Anthropic or Google tool?

No. LLM Tokens is an independent tool by Hamperpick Ventures LLP, the company behind Tecyfy.

Where do I report a problem or ask for a model?

Write to contact@hamperpick.in. More about the extension is on its page on hamperpick.in.

Licences

MIT. The tokenizer files are the makers' own, under their licences (data/NOTICE.txt); bundled libraries are listed in THIRD-PARTY-NOTICES.txt.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft