Illustration of pasted text being split into token blocks with an estimated count

Token Counter

Paste text and pick a model to see an estimated token count. Approximate, not exact: no major provider ships a small client-side tokenizer, so this blends a characters-per-token and words-per-token heuristic instead of running the model's real BPE/SentencePiece tokenizer. Expect real counts to differ by roughly ±10-20%, more for code or non-English text. Data as of August 2026 — see Context Window Calculator to check whether it fits a model's limit.


💻 Show API usage examples (cURL)
curl -sS -X POST https://devops.majbase.com/token-counter/api -H "Content-Type: application/json" -d '{"text":"Hello, world!","model":"claude-sonnet-5"}'

Returns {"model", "char_count", "word_count", "estimated_tokens"}, or {"error": "..."}. Valid model ids: claude-opus-5, claude-sonnet-5, claude-haiku-4.5, gpt-5.5, gpt-5, gpt-4o, gemini-3-pro, gemini-3-flash.

🤖 Use this API as a Claude Skill

Want an AI agent (Claude Code, claude.ai, or anything else that supports the Agent Skills format) to use this tool for you on request? Download the skill below and add it:

⬇️ Download SKILL.md · View raw