Tokens

LLM token calculator — count tokens in any text

Paste any text, count tokens, see the cost on each OpenAI model, and find the Plugsky model tier that fits your context window.

Your text

What are tokens?

LLMs break text into tokens — sub-word units of 1-4 characters. English averages ~0.75 words per token, so a 750-word document is roughly 1,000 tokens. Code, languages other than English, and numbers have different ratios.

Plugsky models have context windows from 16K (plugsky-micro) to 131K (plugsky-frontier, plugsky-max, plugsky-ultra). Use this calculator to see if your text fits.

Try Plugsky

Flat monthly pricing, unlimited usage on every model in your tier.

Start $5 trial → See 18+ models
(function(){ function countTokens(s) { if (!s) return 0; // Approximation: ~4 chars per token, with word boundary adjustment // Better than just chars/4 for mixed code/English var words = s.split(/\s+/).filter(Boolean).length; var chars = s.length; return Math.max(Math.ceil(chars / 4), Math.ceil(words * 1.3)); } function fmt(n) { return n.toLocaleString(); } function fmtCents(c) { return '$' + (c/100).toLocaleString(undefined, {minimumFractionDigits: 4, maximumFractionDigits: 4}); } var WINDOWS = { 'gpt-4o': { max: 128000, label: 'gpt-4o' }, 'gpt-4o-mini': { max: 128000, label: 'gpt-4o-mini' }, 'claude-sonnet': { max: 200000, label: 'Claude Sonnet' }, 'plugsky-frontier': { max: 131072, label: 'plugsky-frontier' }, 'plugsky-pro': { max: 65536, label: 'plugsky-pro' }, 'plugsky-micro': { max: 16384, label: 'plugsky-micro' } }; document.getElementById('text').oninput = function() { document.getElementById('chars').value = document.getElementById('text').value.length; }; document.getElementById('text').oninput(); document.getElementById('calcBtn').onclick = function() { var s = document.getElementById('text').value; var model = document.getElementById('model').value; var w = WINDOWS[model]; var tokens = countTokens(s); var pct = Math.round((tokens / w.max) * 100); var fills = Math.min(100, pct); var out = document.getElementById('result'); out.style.display = 'block'; out.innerHTML = '
Estimated tokens
\n' + fmt(tokens) + '\n\n
Model context window
\n' + w.label + ' — ' + fmt(w.max) + ' tokens' + '\n\n
Usage
\n
' + pct + '%
' + (pct >= 100 ? '\n
⚠ Text exceeds model context window. Use a longer-context model or split into chunks.
' : ''); }; document.getElementById('calcBtn').click(); })();