Why count tokens?
Large language models bill and truncate by tokens, not characters. Accurate counts help you stay inside context windows and estimate cost before calling an API.
stbox uses js-tiktoken in the browser to show live counts, visual BPE pieces, and a rough cost matrix across popular models.
How to use this tool
- Paste prompt or completion text into the editor.
- Pick a model encoding profile to refresh token pills and counts.
- Read context-window usage and estimated input/output costs.
Frequently asked questions
Are non-OpenAI counts exact?
OpenAI encodings are exact via tiktoken. Other vendors are approximated with compatible encodings for planning — always verify with the provider tokenizer for billing-critical work.
Is my data sent to a server?
BPE Token Calculator runs 100% in your browser. Inputs stay on your device and are not logged or stored by stbox servers.