Tokens, Words and Characters Calculator for LLMs

Tokens can be thought of as pieces of words. Before processing, the input is broken down into tokens that don't necessarily align with word boundaries.

For a detailed explanation of tokens and how to count them, see the OpenAI Tokenizer Guide.

How this calculator works

This calculator uses the actual GPT-2 tokenizer (the same one used by many OpenAI models) to provide precise token counts. It:

Note: While this calculator uses the GPT-2 tokenizer, some newer models might use slightly different tokenizers. For model-specific token counts, please use OpenAI's Tokenizer tool.

Calculate from Text

Note: All calculations are performed locally - no text leaves your browser.

Show text input

Text processing:

Calculate from Tokens

Words: 0
Characters: 0

Calculate from Words

Tokens: 0
Characters: 0

Calculate from Characters

Tokens: 0
Words: 0

Tool made by Denis Shiryaev, shir-man.com

Other LLM Tools

🏠 Browser-based LLM Playground

🛠️ Text Processing Toolkit

📄 Text File Merger for LLM

📝 PDF to TXT Converter

🗑️ HTML to TXT Converter

🤖 LLM System Prompt Generator

💡 Creative Idea Generator