ToolCraft
HomeAI ToolsDeveloper ToolsUnit ConverterImage Tools
ToolCraft

© 2026 ToolCraft. All rights reserved.

Privacy PolicyTerms of Service
DMCA.com Protection Status
HomeDeveloper ToolsToken Counter (LLM)

Developer Tools

JSON FormatterBase64 Encoder/DecoderUUID GeneratorRegex TesterHash GeneratorCurl ConverterMarkdown PreviewURL Encoder/DecoderHTML Encoder/DecoderJWT DecoderCron Expression ParserDiff CheckerSQL FormatterCSS Minifier / BeautifierHTML MinifierJavaScript MinifierYAML / JSON ConverterXML / JSON ConverterIP Subnet CalculatorHTTP Status CodesUnix Permissions CalculatorFake Data GeneratorJSONPath TesterJSON Schema ValidatorJSON to TypeScriptUser Agent ParserMIME Type LookupASCII TableMeta Tag GeneratorRobots.txt GeneratorSitemap GeneratorTOML ↔ JSON ConverterSVG OptimizerCSS Unit ConverterAPI Request BuilderCode ScreenshotJSON to PHP ArrayProperties / JSON ConverterJSON / SQL ConverterYAML / TOML ConverterJSON to HTML TableCSV to SQLToken Counter (LLM)OpenAPI / Swagger Viewer

Token Counter (LLM)

Count tokens for GPT, Claude, and Gemini prompts. Exact via tiktoken for OpenAI models, approximation for Claude/Gemini.

Ctrl+Shift+CCopy output

Used by GPT-4o, GPT-4o-mini, GPT-4-Turbo (2024+).

Token count
0tokens
Characters
0
Words
0
Chars/token
0

View all Developer Tools

View all
100% offline

JSON Formatter

Format, validate, and minify JSON data with syntax highlighting

Developer Tools
100% offline

Base64 Encoder/Decoder

Encode and decode Base64 strings

Developer Tools
100% offline

UUID Generator

Generate and validate UUIDs (v4)

Developer Tools
100% offline

Regex Tester

Test regular expressions with real-time matching

Developer Tools

What is the Token Counter for LLMs?

Large language models read text as a sequence of "tokens" — chunks of one or several characters that map to a numeric vocabulary. OpenAI bills GPT-4 and GPT-3.5 per token, Anthropic bills Claude per token, and every model has a hard context-window limit (8K, 128K, 200K, 1M+ tokens). The Token Counter computes the exact token count for OpenAI models (using tiktoken-compatible BPE encoders running in your browser) and a chars-per-token approximation for Claude and Gemini, whose tokenizers Anthropic and Google have not published. Use it to verify a prompt fits the context window, predict API costs, or debug truncation issues — all without sending the text anywhere.

Quick reference: chars per token (English)

GPT-4 / GPT-3.5 (cl100k_base): ~3.5-4 chars/token GPT-4o (o200k_base): ~4-4.5 chars/token (better compression) Claude (estimate): ~3.5 chars/token Gemini (estimate): ~4 chars/token For CJK languages (中文、日本語、한국어), the ratio drops to ~1.5-2 chars/token because each glyph carries more semantic load.

FAQ