Microsoft Token Counter
Count Microsoft tokens online and see what your text costs across all 3 models, including MAI Code 2, MAI Code 2 Flash and MAI-Image-2. Everything runs in your browser and nothing you paste leaves the page. Counts are estimates made with the cl100k_base encoding, since Microsoft has not released a browser-ready tokenizer. Estimated counts are marked with a tilde (~).
| Model | Tokens | Input Cost | Output Cost |
|---|---|---|---|
| MAI Code 2 | — | — | — |
| MAI Code 2 Flash | — | — | — |
| MAI-Image-2 | — | — | — |
Type or paste text above to see token counts and per-request costs for every Microsoft model.
Microsoft Model Pricing
| Model | Input /1M | Output /1M |
|---|---|---|
| MAI Code 2 | $0.500 | $2.50 |
| MAI Code 2 Flash | $0.050 | $0.250 |
| MAI-Image-2 | $5.00 | $33.00 |
Frequently Asked Questions
Common questions about counting Microsoft tokens
Which tokenizer does Microsoft use?
Microsoft uses its own tokenizer, which is not publicly available to run in a browser. This counter estimates counts with OpenAI's cl100k_base encoding, which is typically within roughly 10 to 20 percent of the real count for English text.
Are these Microsoft token counts exact or estimated?
Estimated. Microsoft has not released its tokenizer for browser use, so this tool approximates counts with OpenAI's cl100k_base encoding. Estimates are usually close for English text but can drift for code, JSON, and non-English languages. Estimated counts are marked with a tilde (~).
How is Microsoft API cost calculated?
Cost equals tokens divided by one million, multiplied by the model's per-million-token rate. Each Microsoft model has separate input and output rates, and this page shows both: what your text would cost as a prompt (input) and what the same number of tokens would cost as a response (output).
Why do token counts matter for Microsoft API costs?
Microsoft bills API usage per token, not per word or character. A token is roughly 4 characters or about three quarters of a word in English. Knowing the token count of your prompts lets you predict spend, stay inside context windows, and compare Microsoft models like MAI Code 2, MAI Code 2 Flash and MAI-Image-2 before you commit.