Words to Tokens Calculator - Tokens to Words Too

Text Input

Convert text or words to tokens, or tokens back to words, for GPT, Claude, and Gemini. Paste text or enter a count. Word-to-token ratio, no API key.

Choose Mode

Enter or Paste Text

Or Upload a File

Or Enter a Count

Every provider's tokenizer counts differently, so this is an approximation rather than what your provider will bill or accept. Run the exact text through your provider's own tokenizer before finalizing a cost estimate or assuming it fits a context window.

Formulas and sources

Each formula this calculator uses, where it comes from, and what it leaves out. "How it works" shows the same formula with your own numbers.

Tokens from text

Simple and Composer modes, for pasted text, a file or a typed character count

Tokens ≈ Characters ÷ C
Tokens
the estimated token count, rounded up
Characters
the characters in the text
C
characters per token: 4 for Generic and GPT, 2.7 for Claude 4.7 and later, 3.2 for Gemini; for JSON, 3.2 for Generic and GPT and 2.4 for Gemini; for CSV, 2.7 and 1.9

Each estimate is rounded up. Claude’s 2.7 is 3.5 ÷ 1.3 = 2.69, rounded to 2.7: Anthropic’s 3.5 characters a token, with about 30% more tokens on the newer tokenizer. Gemini’s 3.2 is the 60-word end of Google’s 60 to 80 words per 100 tokens; Google’s page says about 4 characters a token. JSON and CSV have their own ratios, because data takes more tokens for its length. A text is JSON when the whole of it is a valid JSON object or array. It is CSV when it has at least three lines, nine in ten of the first fifty split into the same three or more short fields at a comma, tab or semicolon, and most lines do not end like code or a sentence. In Composer each section is checked on its own. Claude has no measured JSON or CSV ratio yet, so a Claude count of either uses its text ratio.

Source: GPT and Generic: OpenAI’s rule of thumb of about 4 characters a token [1]. Claude: CalcTrail’s own estimate, from Anthropic’s “about 3.5 characters” [2] and its “approximately 30%” more tokens [3]. Gemini: CalcTrail’s own estimate, within Google’s range [4]. Anthropic calls its own token count an estimate [5]. JSON and CSV: CalcTrail’s own measurement on October 7, 2026, counting generated JSON and CSV samples with the o200k_base tokenizer OpenAI uses for its GPT-5 models [6] and with Google’s token counter [4].

Tokens from a word count

Simple mode, when a word count is typed

Tokens ≈ Words × R
Tokens
the estimated token count, rounded up
Words
the word count you type
R
tokens per word: about 1.333 for Generic and GPT, 1.9748 for Claude 4.7 and later, 1.6663 for Gemini

R is OpenAI’s 1.333 tokens a word (1 ÷ 0.75), scaled by each family’s characters per token. One word is 5.33 characters in every family, so a typed word, character or token count gives the same estimate.

Source: Based on OpenAI’s rule of thumb of 0.75 words a token [1]; Claude and Gemini are scaled as above, CalcTrail’s own estimates [2] [3] [4].

Words from a token count

Simple mode, when a token count is typed

Words ≈ Tokens ÷ R
Words
the estimated word count, to the nearest word
Tokens
the token count you type
R
tokens per word, as above

So 8,000 tokens is about 6,002 words at the generic ratio and about 4,051 for Claude 4.7 and later.

Source: Based on OpenAI’s rule of thumb of 0.75 words a token [1].

Exact count for GPT-5

Simple and Composer modes, when you select Count exactly for GPT-5

The text is counted with o200k_base, the tokenizer OpenAI’s own tiktoken assigns to its GPT-5 models. It runs in your browser, so the text is not sent anywhere; about 1 MB is downloaded the first time. OpenAI names no tokenizer for GPT-6, and Claude and Gemini have none a browser can run, so their counts stay estimates.

Source: OpenAI’s tiktoken model map [6]; counted with gpt-tokenizer 4.0.0, an open-source implementation of the same tokenizer.

Composer total

Composer mode

Each section is counted on its own and rounded up, then the counts are added, so the section shares add up to 100%.

Source: CalcTrail’s own; no publisher.

Counts of the text

Simple and Composer modes, for pasted text or a file

Words are the pieces of text between spaces, so a language written without spaces counts as one word. Characters are code units as stored, so an emoji counts as 2. A sentence ends at ".", "!" or "?" before a space or the end, so the count is approximate. An entered count has no text, so it shows no sentence, line or word-length figures; its words and characters follow from the ratio.

Source: CalcTrail’s own; no publisher.

Context window fit

Simple and Composer modes

Share = (Tokens + Expected reply) ÷ Window. A share of 90% or more is marked tight, because the token count is an estimate. Each family is checked against one current model and its reply limit, from CalcTrail’s model catalog.

Source: CalcTrail’s own; no publisher.

Ways to use fewer tokens

Simple and Composer modes

Minify the JSON removes the white space outside strings and changes no value. Turn it into CSV appears for a list of two or more objects with the same flat keys and no number too long to keep exactly. Remove extra spaces and blank lines keeps each line’s indentation, appears for text that is not JSON or CSV, and is offered when it saves at least 5% of the text. Each shows the characters it saves, exactly, and about how many tokens; a saving under 16 characters is not shown. In Simple mode a note appears when a prompt is over 2,000 tokens or has more than 50 lines. In Composer one appears when one of two or more sections is over 40% of the tokens, or when the Examples section is over 500 tokens.

Source: CalcTrail’s own rules and thresholds; no publisher.

Sources

  1. OpenAI. Key concepts, section "Tokens". Undated page, read October 5, 2026.
  2. Anthropic. Glossary, entry "Tokens". Undated page, read October 5, 2026.
  3. Anthropic. Pricing, section "Additional notes": the tokenizer of Claude 4.7 and later. Undated page, read October 5, 2026.
  4. Google. Understand and count tokens, its opening section on tokens. Undated page, read October 5, 2026.
  5. Anthropic. Token counting, its notes on the newer tokenizer and on estimates. Undated page, read October 5, 2026.
  6. OpenAI. tiktoken, tiktoken/model.py, the model-to-encoding map. Main branch, read October 7, 2026.

What this calculator does not cover

  • Its estimates run no provider’s tokenizer. The exact GPT-5 count runs OpenAI’s, when you ask. No result is a billed count.
  • It does not count images, video, PDFs or tool definitions, which providers also count in tokens.
  • A provider’s count can include tokens the provider adds itself; Anthropic does not bill those.
  • The Claude row is Claude 4.7 and later. It does not model the older tokenizer of Claude 4.6 and earlier.
  • The text ratios are for English prose, and JSON and CSV have their own. A ratio is an average: numbers-heavy data takes more tokens than it says, and code, other languages and emoji can too.

Sources checked on .

Help

Quick Start Guide

  1. Choose Mode: Select Simple to count one piece of text, or Composer to count a prompt section by section.
  2. Enter or Paste Text: Type or paste the text you want to analyze into the input field.
  3. Or Upload a File: Upload a .txt, .docx, .json, or .csv file up to 5MB for automatic text extraction. The file is read in your browser, and a .json or .csv file is counted as the text it holds.
  4. Or Enter a Count: No text yet? Switch to "Enter a count" and type a word, character or token number directly.
  5. View Token Count: See the estimated token count for your selected model.
  6. Pick a Model Family: Under "Estimate for", pick Generic, GPT models, Claude models or Gemini models. Each applies its own characters-per-token ratio, shown in the picker.
  7. Count Exactly for GPT-5 (Optional): Select "Count exactly for GPT-5" under the estimate to see the exact count and how far the GPT estimate is off. Claude and Gemini stay estimates.
  8. Use Fewer Tokens: Under "Ways to Use Fewer Tokens", select Apply to minify JSON, turn a flat JSON list into CSV, or remove extra spaces. Select Undo to restore the text.
  9. View Text Metrics: See word count, character count, and other text metrics alongside the token count.
  10. Estimate API Cost: Use the one-click handoff to send your token count to the LLM Token Cost Calculator.

Frequently Asked Questions

Paste or type your text and the calculator estimates token count instantly. Don’t have the text yet? Switch to "Enter a count" and type a word, character or token number instead; no placeholder text is needed. OpenAI’s rule of thumb for English text is 1 token ≈ 0.75 words, or about 4 characters. Each provider’s tokenizer counts a little differently: the GPT, Claude and Gemini options apply each family’s characters-per-token ratio, so switching between them shows the likely spread, and a GPT-5 count can be made exact on request. To convert text to tokens, paste or type it and the calculator estimates the token count instantly.

Last updated