---
title: "Granite Token Counter for Granite 4.2, 4.1 & 4.0"
description: "Free Granite token counter for IBM's Granite 4.2 (3B, 8B, 30B), Granite 4.1, and Granite 4.0. The real tokenizers run in your browser, with context-window usage as you type."
canonical: https://holaclaw.ai/tools/token-counter/granite
---

# Granite Token Counter

Count tokens for IBM's Granite 4.2, 4.1, and 4.0 models and see how much of their 128K context your text fills. The real tokenizers run in your browser.

Use it at [holaclaw.ai/tools/token-counter/granite](https://holaclaw.ai/tools/token-counter/granite).

## Counting tokens for Granite models

**IBM publishes the tokenizer with every Granite checkpoint, so the counts on this page are exact.** Granite 4.2 8B and 3B load by default and share one count. Granite 4.1 and 4.0 use a different tokenizer that counts noticeably lower on the same text, so add one of them from the compare table to see both numbers. Every model shows as free: the weights are open under Apache 2.0 and these sizes run on your own hardware, so the context bar against the 128K window is the figure that matters.

## Pricing and context windows

Granite models with their tokenizer and context window. The weights are open under Apache 2.0, so they show as free.

| Model | Tokenizer | Price / 1M input | Context window |
| --- | --- | --- | --- |
| Granite 4.2 30B | granite-4.2 | Free | 131K |
| Granite 4.2 8B | granite-4.2 | Free | 131K |
| Granite 4.2 3B | granite-4.2 | Free | 131K |
| Granite 4.1 8B | cl100k_base | Free | 131K |
| Granite 4.0 H-Small | cl100k_base | Free | 131K |

Prices and context windows are curated metadata refreshed periodically from the providers and OpenRouter, so treat them as guidance rather than a quote. Token counts are always produced by the real tokenizer.

## How Granite tokenization works

**Granite 4.x builds on GPT-4's cl100k_base vocabulary, but Granite 4.2 splits text differently from 4.0 and 4.1.** All Granite 4.x models share a 100,352-entry vocabulary whose 100,256 ordinary entries and merge rules are those of OpenAI's cl100k_base; the rest are IBM's special tokens. Granite 4.0 and 4.1 also keep the cl100k splitting rule, so on plain text they count exactly like GPT-4 Turbo: 574 tokens on our fixed 500-word sample. Granite 4.2 switched to the older GPT-2 splitting rule, which keeps whole digit runs together and never merges punctuation into a following line break. On English prose that adds a couple of percent (584 tokens on the same sample), and on code and JSON the gap can reach 15 to 20 percent.

Both generations tokenize the same way in llama.cpp and Ollama as in this tool, so the number matches what a local run reports. Granite 4.2 reasons before answering in thinking mode; that reasoning is generated at reply time and consumes context on top of the input counted here.

## Frequently asked questions

### Do Granite 4.2, 4.1, and 4.0 use the same tokenizer?

**Same vocabulary, but Granite 4.2 uses a different splitting rule.** Granite 4.0 and 4.1 share one tokenizer file. Granite 4.2 keeps the vocabulary but applies the GPT-2 rule before merging, so it produces more tokens on the same text, especially on code, numbers, and structured data. This page keeps them as two tokenizers for that reason.

### Can I use a GPT-4 token counter for Granite?

**For Granite 4.0 and 4.1, yes. For Granite 4.2, no.** Granite 4.0 and 4.1 count exactly like cl100k_base on plain text, so a GPT-4 Turbo count carries over. Granite 4.2 runs a couple of percent higher on prose and much higher on code, so use its own count.

### How large is Granite's context window?

**128K tokens for the 4.x models, with 32K on the two 350M Nano sizes.** IBM describes long-context extension to 512K for Granite 4.1 and 4.2, but the model configuration files set 131,072 tokens and that is what hosts serve. The context bar here uses 128K.

### Which Granite models does this cover?

**Granite 4.2 3B, 8B, and 30B, plus Granite 4.1 8B and Granite 4.0 H-Small.** The 4.2 count applies to every Granite 4.2 size and its GGUF and FP8 builds. The 4.1 count applies to all Granite 4.1 and 4.0 sizes, including the Nano models. Granite 3.x used a different 49,000-entry vocabulary and is not covered.

## Token counters for other models

- [Compare all model families on the full token counter](/tools/token-counter.md)
- [OpenAI Token Counter](/tools/token-counter/openai.md)
- [Claude Token Counter](/tools/token-counter/claude.md)
- [Gemini Token Counter](/tools/token-counter/gemini.md)
- [DeepSeek Token Counter](/tools/token-counter/deepseek.md)
- [Qwen Token Counter](/tools/token-counter/qwen.md)
- [Mistral Token Counter](/tools/token-counter/mistral.md)
- [Grok Token Counter](/tools/token-counter/grok.md)
- [Muse Glimmer Token Counter](/tools/token-counter/muse-glimmer.md)
- [GLM Token Counter](/tools/token-counter/glm.md)
- [MiniMax Token Counter](/tools/token-counter/minimax.md)
- [Phi-4 Token Counter](/tools/token-counter/phi.md)
- [Nemotron Token Counter](/tools/token-counter/nemotron.md)
- [Ornith Token Counter](/tools/token-counter/ornith.md)
- [Agents-A1 Token Counter](/tools/token-counter/agents-a1.md)
- [SmolLM3 Token Counter](/tools/token-counter/smollm.md)

