Text chunker
Compare fixed, sentence and Markdown splitting on your own text, with every chunk drawn to scale.
Free · no account · nothing uploaded
Paste a prompt, a document or an entire conversation and see the token count, what it costs to send across common models, and how much of each context window it consumes.
Say it the way you would say it to a person. Your words are matched to one of 18 tools by readable rules, and the tool runs right here in your browser. No upload, no account.
This tool runs in your browser and needs JavaScript turned on.
/tokens.Things you can type: how many tokens is it will this fit in gpt-4?
A language model does not read words. It reads tokens — sub-word fragments produced by a byte-pair encoding — and every limit that constrains your work is expressed in them: the context window, the price per call, the truncation point where your carefully assembled sources silently fall off the end.
Character counts and word counts are poor proxies. Code, JSON, URLs, non-English text and long identifiers all tokenize far more expensively than prose, sometimes at three times the rate. If you are budgeting a retrieval pipeline or debugging why a prompt got cut off, an estimate that is 30% wrong is not useful.
Paste or drop text and you get, immediately and locally:
The count comes from o200k_base, the byte-pair encoding GPT-4o and GPT-4.1 use. It is loaded from this site the first time you run the tool, and the count is exact for those models. Claude, Llama and Gemini each use their own tokenizer, so their true counts differ somewhat; treat the figure as a close guide for them.
If the tokenizer cannot be fetched — you are offline, or opening the page from a file — the tool falls back to a heuristic and says on screen that the number is an estimate.
That labelling is deliberate. A silently wrong token count is worse than an admitted approximation, because it is the kind of error you only discover after a pipeline has been built on top of it.
Token budgeting is the first constraint you hit when you stop chatting and start building context. It decides how many chunks you can retrieve, how much of a source you can quote, and whether a long report can be produced in one pass or has to be assembled.
FlexContext exists for that problem at the other end of the scale: keeping a growing library of documents, pages, transcripts and datasets, and choosing precisely which parts of it a model sees for a given question.
Questions
Yes — free, with no account and no sign-up. It runs entirely in your browser tab; your text is never uploaded anywhere.
It prices a set of commonly used models and shows the context-window fill for each. The numbers are list prices for input tokens, so treat them as a planning figure rather than an invoice.
Exact for GPT-4o and GPT-4.1, which use the o200k_base tokenizer this tool runs. Other model families tokenize differently, so for them it is a close guide rather than an exact figure. If the tokenizer cannot load, the tool falls back to a heuristic and labels the result an estimate on screen.
Yes. Drop a text, Markdown, CSV, JSON or HTML file anywhere on the page and it opens in the right tool with its contents loaded.