---
title: "Phi-4 Token Counter for Phi-4, Reasoning Plus & Mini"
description: "Free Phi-4 token counter for Microsoft's Phi-4 14B, Phi-4 Reasoning Plus, and Phi-4 Mini. The real Phi-4 tokenizer runs in your browser and shows how much of the 16K context your text uses."
canonical: https://holaclaw.ai/tools/token-counter/phi
---

# Phi-4 Token Counter

Count tokens for Microsoft's Phi-4 models and see how much of their context window your text fills. The real tokenizer runs in your browser.

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

## Counting tokens for Phi-4 models

**Microsoft publishes Phi-4's tokenizer with the MIT-licensed weights, so the counts on this page are exact.** Phi-4 and Phi-4 Reasoning Plus load by default and share one count. Phi-4 Mini uses a different, larger vocabulary, so add it from the compare table to see its own number. All three show as free: the weights are open and small enough to run on your own Mac, so the useful figure here is the context bar rather than the cost. Phi-4 has a 16K window, which a long document fills quickly.

## Pricing and context windows

Phi-4 models with their tokenizer and context window. The weights are open under the MIT license, so they show as free.

| Model | Tokenizer | Price / 1M input | Context window |
| --- | --- | --- | --- |
| Phi-4 | phi-4 (cl100k) | Free | 16K |
| Phi-4 Reasoning Plus | phi-4 (cl100k) | Free | 33K |
| Phi-4 Mini | o200k_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 Phi-4 tokenization works

**Phi-4 reuses OpenAI's cl100k_base vocabulary, the encoding behind GPT-4, padded to 100,352 entries.** Microsoft's technical report says Phi-4 switched to the tiktoken tokenizer for better multilingual support. The 100,256 entries and the merge rules are those of cl100k_base; the remaining 96 slots hold Phi's own special tokens for chat formatting and reasoning, which never appear in pasted text. So Phi-4, Phi-4 Reasoning, Phi-4 Reasoning Plus, and Phi-4 Reasoning Vision all count exactly like GPT-4 Turbo: 574 tokens on our fixed 500-word sample.

The Phi-4 Mini line (Mini, Mini Reasoning, Mini Flash Reasoning, and Multimodal) uses o200k_base instead, the 200,000-entry vocabulary behind GPT-4o and GPT-5. It packs text a little tighter, especially code and non-English text, so this page loads that encoding for Phi-4 Mini and counts it separately.

## Frequently asked questions

### Is this Phi-4's official tokenizer?

**Yes. It is the tokenizer file shipped with the weights on Hugging Face.** The vocabulary is cl100k_base with Microsoft's special tokens appended, and the text is tokenized in your browser, so the count is exact and nothing is uploaded. Ollama and llama.cpp load the same vocabulary, so the number matches what you see when running the model locally.

### Do Phi-4 and Phi-4 Mini tokenize the same way?

**No. Phi-4 uses cl100k_base and Phi-4 Mini uses o200k_base.** Ordinary English lands close on both, but Mini's larger vocabulary usually needs fewer tokens on code and other languages. Add Phi-4 Mini from the compare table to see both counts for your text.

### How much of Phi-4's 16K context will my text use?

**The context bar above the editor shows the share of the window your text fills.** Phi-4 has a 16,384-token window and Phi-4 Reasoning Plus 32,768, so a few pages of text is a meaningful fraction. A reasoning model also spends part of the window on its thinking trace before it answers, so leave room for the reply.

### Which Phi models does this cover?

**Phi-4, Phi-4 Reasoning Plus, and Phi-4 Mini, plus the variants that share their tokenizers.** Phi-4 Reasoning and Phi-4 Reasoning Vision count like Phi-4; Phi-4 Mini Reasoning, Mini Flash Reasoning, and Phi-4 Multimodal count like Phi-4 Mini. The older Phi-3 models use a different 32,000-entry vocabulary and are 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)
- [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)
- [Granite Token Counter](/tools/token-counter/granite.md)

