Token Counter

Counted using GPT tokenization. Other models may give different results.

0Tokens
0Words
0Characters
0Characters without whitespace

Whitespace details

0Spaces
0Line breaks
0Tabs
0Other whitespace

Spaces, line breaks and tabs are character counts. Whitespace can share a token with nearby text, so these numbers cannot be subtracted from the token total.

Token boundaries

Token boundaries will appear after you enter text.

A character may span more than one token. Individual byte fragments are shown as hexadecimal values to keep the original text intact.

Token IDs and bytes

    Use this free token counter and token calculator to measure text before using it in an AI prompt. See token, word and character counts, inspect whitespace, and explore how text is split into tokens.

    Token counter questions

    What does this token calculator count?

    It counts the tokens in the text you enter, using the o200k_base GPT tokenization rules. It also shows words, characters and whitespace counts. Tokens may contain a word, part of a word, punctuation or whitespace.

    Is one character always one token?

    No. A token may contain several characters or only part of a word, and one character may use several tokens. Emoji and letters with combining marks can also use multiple tokens even when they look like a single character. There is no fixed character-to-token ratio.

    How are Chinese, Japanese and Korean text counted?

    All three are supported, but grouping them as CJK does not give them a shared token count per character. Common character sequences may form one token, while a single character or syllable may be split into several. The count depends on the actual text and tokenization rules, not just the language.

    What about other languages and mixed text?

    The counter also supports text in Latin, Cyrillic, Arabic, Indic and other scripts, including mixed-language text. Words may be split into smaller pieces, so English word or character estimates do not apply to every language. Translations of the same sentence can have different token counts.

    How are characters and words counted?

    In modern browsers, a Han character, Japanese kana, Korean syllable or Latin letter usually counts as one character. A letter with a combining accent or a combined emoji usually also counts as one. Whitespace and punctuation are included. Words follow language-aware boundaries, so a CJK passage is not treated as one word simply because it has no spaces. Both counts are separate from tokens.

    Do spaces count as tokens?

    Spaces and other whitespace are included when counting tokens. A space may be combined with the following word or appear in a separate token. Removing a space can change nearby token boundaries, so one space does not always mean one token.

    Will this count match every AI model?

    No. Models can use different tokenization rules. This tool provides a GPT reference count for plain text. Complete chat requests may also contain roles, message formatting and tool definitions, so their total usage can differ.

    Is my text uploaded?

    No. Text and imported files are counted in your browser. The tool does not send their contents to a counting service.

    Is there a text or file size limit?

    There is no fixed text length or file size limit. Large inputs take more time and depend on your device’s available memory. The tool counts the full text and previews only the first 500 tokens; the preview does not reduce the total. Use Clear to stop the current count.

    Related tools: Word Counter

    Code Formatters

    Format and beautify Java, Python, JavaScript, JSON, HTML and more; adjust indentation, spacing and line breaks.

    More tools

    Audio Editing & Effects

    Trim, join or split recordings, remove silence or noise, and adjust volume, speed, pitch or channels.

    More tools

    Spreadsheet Tools

    Open and edit CSV or Excel sheets, format tabular text, and convert CSV to Excel or SQL.

    More tools

    Markdown Tools

    Write and preview Markdown, render Mermaid diagrams, and convert Markdown, HTML and tables between formats.

    More tools

    Text Tools

    Compare passages, count words and keywords, sort or replace lines, and view DOCX text.

    More tools

    Dictionaries

    Look up Chinese meanings, synonyms and antonyms, or find IPA pronunciations in multiple languages.

    Audio Conversion & Playback

    Convert between MP3, WAV, FLAC and more, play audio or raw PCM, and inspect or edit audio metadata.

    JSON & Data Tools

    Inspect, compare and validate JSON; test JSONPath expressions, or convert data to CSV, YAML and XML.

    More tools

    Speech Tools

    Transcribe audio to text, generate speech from text, or record your voice in the browser.

    Video Tools

    Convert and compress video, trim or join clips, resize frames, and extract audio.

    More tools

    Video Playback & Recording

    Play local or streaming video, record your screen or camera, and use your camera as an online mirror.

    PDF Tools

    Compress or merge PDFs, split and rearrange pages, convert pages to images, and view or compare documents.

    More tools

    Image Tools

    Convert image formats, resize or crop photos, compress files, compare pictures, and extract text with OCR.

    More tools

    Image Creation

    Capture and beautify screenshots, turn text into images or GIFs, draw on a whiteboard, and create word clouds or favicons.

    More tools

    Subtitle Tools

    Edit SRT or VTT captions with a video preview, shift timing, convert formats, and manage subtitle tracks.

    More tools

    Archive Tools

    Open ZIP, 7Z, RAR or TAR files, extract selected contents, and create new archives with optional ZIP/7Z passwords.

    Encoders | Decoders

    Encode and decode Base64 or Base32, escape URLs, HTML and Unicode text, and inspect JWT contents.

    More tools

    Number Tools

    Convert number bases and values between binary, decimal and hex; turn numbers into words or text into binary.

    Calculators

    Work out percentages and fractions, summarize statistics, and calculate grades, discounts or aspect ratios.

    More tools

    Time Tools

    Show an online clock, run a countdown or stopwatch, and calculate dates, ages or time-zone differences.

    More tools

    Network Tools

    Check your IP and IPv6 connection, inspect HTTP requests or HAR files, and calculate CIDR address ranges.

    Unit Conversions

    Convert length, weight, temperature, data storage and other units.

    Color Tools

    Convert HEX, RGB and HSL values, extract colors from an image, check contrast, or test your display with solid colors.

    QR Codes & Barcodes

    Generate and scan QR codes or barcodes, including QR codes for links and Wi-Fi networks.

    Developer & Security Tools

    Generate hashes, UUIDs and passwords, test regular expressions, create URL slugs and check file permissions.

    More tools

    Utility Tools

    Check screen resolution and refresh rate, measure with a screen ruler, test keys, or read from a teleprompter.

    More tools

    Games

    2048, Minesweeper, Sudoku, Gomoku, Tank Battle

    More tools