DFK Studio

Split text into chunks

Split a long document into overlapping chunks sized in tokens, cut at paragraph and sentence boundaries instead of mid-word. Runs in your browser.

  • Free, no account
  • Nothing is uploaded
  • Runs in your browser

How it works

  1. 1 What goes in A long text
  2. 2 It runs in your browser On your own device. Nothing is uploaded, there is no queue and no account, and it keeps working with the network switched off.
  3. 3 What comes back It, cut where a model can take it

What it does

Set a chunk size in tokens and an overlap, and get a long document back as pieces that end where a paragraph or a sentence ends. Every chunk can be copied on its own, or the whole set downloaded as JSON or JSONL.

This page does the work itself. Your text is handled by the browser and never sent anywhere — there is no server here to send it to.

Questions

Why overlap the chunks at all?

Because the answer to a question is often the sentence that straddles a cut. Without overlap, a chunk boundary can land in the middle of the one passage that mattered and neither chunk retrieves well. An overlap of ten to twenty percent of the chunk size is the usual starting point; more than that mostly buys duplicate results.

Where does it decide to cut?

It prefers a blank line, then the end of a sentence, then a line break, then a space — in that order, taking the last one that fits inside the budget. Cutting mid-word is the last resort and only happens when a single word is longer than the whole chunk. Splitting purely by character count is what produces chunks that start halfway through a clause.

What chunk size should I use?

It depends on what you are retrieving for, not on the model's context window. Small chunks of two or three hundred tokens retrieve precisely and lose surrounding context; a thousand or more keeps the context and dilutes the match. Most retrieval setups land between those, and the honest answer is that it is worth trying two sizes against real questions rather than taking a number from a blog post.

Every shelf