Your text stays in this browser. Nothing you paste is uploaded.
Gemini API token counts may differ for structured messages, system instructions, tools, media, and model-specific processing.
Count text tokens, inspect token boundaries and IDs, and keep your prompt in the browser.
Your text stays in this browser. Nothing you paste is uploaded.
Gemini API token counts may differ for structured messages, system instructions, tools, media, and model-specific processing.
This page runs a Gemini-compatible SentencePiece tokenizer locally in a Web Worker. Token IDs and boundaries come from the tokenizer rather than from splitting text on spaces.
Only plain text is encoded. The tool does not add chat templates, roles, system instructions, tools, or media tokens, so API usage can differ.
For request-volume and output-token calculations, see the monthly LLM API cost guide. Using OpenAI? Check the current OpenAI API token prices.
It shows the total token count, token boundaries, token IDs, characters, and words for the plain text you enter.
No. StackLens provides a local Gemini-compatible tokenizer for inspecting plain text. It does not call the Gemini API or represent an official Google interface.
Not always. Structured messages, system instructions, tools, files, images, audio, video, and model-specific processing can add or change tokens in an API request.
No. The displayed IDs belong to the local tokenizer used by this page and should not be treated as official IDs returned by the Gemini API.
No. Tokenization runs locally in your browser, and StackLens does not upload the text you enter.
No. This page is for plain text. Use the Gemini API token-counting method when you need provider-side counts for structured or multimodal requests.