RAG Chunking Simulator

Load your own documents, split them six different ways, watch exactly where each chunk starts and ends, and export the chunks you like as JSONL for your vector database.

Draait in je browser. Je bestanden verlaten je apparaat nooit. Zie hoe je dit controleert

…

Zo doe je het

  1. 1
    Add documents

    Open text or Markdown files, or paste text into a new document.

  2. 2
    Pick a strategy

    Choose fixed, sentence, paragraph, recursive or heading-aware chunking.

  3. 3
    Set size and overlap

    Move the sliders and watch the chunk count and token range change.

  4. 4
    Inspect boundaries

    Read the coloured view for cut sentences, split lists and lost headings.

  5. 5
    Check the stats

    Look at the size histogram, tiny chunks and near duplicates, and compare all strategies.

  6. 6
    Export

    Download chunks.jsonl with text, offsets, token counts and heading paths.

Over deze tool

Retrieval-augmented generation answers questions from your documents by finding the most relevant pieces and handing them to the model, and those pieces are only as good as the way the text was cut. Chunks that are too small lose context: a sentence that says it costs 5 dollars without saying what it is. Chunks that are too large blur several topics into one vector and match vaguely. Cuts in the middle of a sentence or table split the answer in two. Most teams pick a splitter and a size once and never look at the result. This simulator lets you look. Paste or open your own text, Markdown or other plain files, choose a strategy and size, and the boundary view colours every chunk in the original text, with overlapping text in red, so you can see whether a heading got separated from its paragraph or a list was cut in half. The chunk list shows each piece with its estimated token count, character offsets and, for Markdown, the heading path it belongs to. The stats tab gives a histogram of chunk sizes, the overhead added by overlap, warnings for tiny and oversized chunks and a list of near-duplicate chunks, which usually point to repeated boilerplate. The compare tab runs all six strategies on your documents at once.

The six strategies

Fixed size (tokens) packs words until the token limit and steps back by the overlap for the next chunk, which gives even sizes but ignores sentence ends. Fixed size (characters) cuts at exact character counts, the simplest splitter. Sentence packing fills each chunk with whole sentences. Paragraph packing fills chunks with whole paragraphs and only falls back to sentences, then words, for a paragraph that is too long. Recursive splitting works the same way with one more level, single lines, which suits lists and code. Heading-aware splitting first cuts Markdown at headings, so no chunk crosses into another section, then packs paragraphs inside each section and records the heading path, such as Returns policy then Faulty items.

Overlap and headings

Overlap repeats the end of one chunk at the start of the next so a fact near a boundary appears whole in at least one chunk. The token strategies overlap by words; the sentence, paragraph and heading strategies overlap only by whole sentences or paragraphs, so overlap may be smaller than the setting. With heading-aware chunks, the export can prefix each chunk with its heading path, a cheap form of contextual chunk header that helps retrieval when a section's text does not repeat its subject.

Export

The JSONL export writes one line per chunk with an id, the text and metadata: source file name, chunk index, start and end character offsets, estimated tokens and the heading path. Offsets let you trace any retrieved chunk back to its exact place in the original document.

Limits

Token counts are estimates of about four characters per token for English; your embedding model's tokenizer may differ by 10 to 20 percent, so leave a margin under its limit. PDFs, Word files and HTML pages need converting to text first, and tables are treated as lines of text. Choosing a strategy by eye is a start; the real test is retrieval quality on your own questions.

Uitgewerkt voorbeeld

A shop's returns policy in Markdown has five sections and about 213 estimated tokens. Heading-aware chunking at 80 tokens with 15 overlap gives five chunks, one per section, from 27 to 61 tokens, with heading paths such as Returns policy > Faulty items and no overlap overhead. Fixed 80-token chunks give four chunks of 80, 80, 79 and 15 tokens, cut across the How to start a return list, with 19.2 percent overlap overhead. Paragraph packing gives four chunks from 27 to 67 tokens with 1.4 percent overhead. The team keeps heading-aware chunks, turns on the heading prefix and exports chunks.jsonl.

In het kort

Veelgestelde vragen

What chunk size should I start with?

Many teams start between 200 and 500 tokens with 10 to 20 percent overlap, then adjust after testing real questions. Short factual documents suit smaller chunks; long explanations suit larger ones.

Why does sentence chunking ignore my overlap setting?

It overlaps by whole sentences only. If the last sentence of a chunk is longer than the overlap, nothing is repeated, which keeps sentences intact.

What are near-duplicate chunks?

Chunks that share at least 80 percent of their five-word phrases. They usually come from repeated headers, footers or disclaimers, and they crowd out useful results at query time.

Can I chunk several documents together?

Yes. Add as many files as you like; each is chunked separately, ids include the document number, and the export names the source of every chunk.

Does the tool create embeddings?

No. It prepares the chunks. Embed the exported JSONL with the model of your choice; the vector storage estimator on this site can size the result.

Are my documents uploaded?

No. Files are read in this tab and chunked in your browser; your documents and settings are kept in local storage on this device.

Helemaal gratisGeen kosten, geen registratie
Bestanden blijven privéAlles draait in je browser
Makkelijk in je eigen taalBeschikbaar in veel talen