>_
RAG

RAG Text Chunker

Preview how a document is split into chunks for embeddings and RAG. Recursive splitting by paragraphs, lines and sentences (Chinese punctuation included), chunk size in tokens or characters, overlap, and JSON export.

Runs locally — your input never leaves this page.

Measure in

    How to use

    1. Paste a document or open a text / Markdown file.
    2. Set the chunk size and overlap, and choose whether size is measured in tokens (o200k_base) or characters.
    3. Inspect each chunk — overlapping text is highlighted — then export the chunks as JSON or JSONL for your embedding pipeline.

    FAQ

    What chunk size should I use?

    A common starting point is 300–800 tokens with 10–20% overlap. Smaller chunks give more precise retrieval; larger ones keep more context. Test with your own questions and documents.

    How does recursive splitting work?

    Text is split at the strongest boundary first — blank lines (paragraphs) — and only pieces that are still too long are split further by lines, sentences, clauses and words. Small pieces are then merged back up to the size limit, so chunks rarely cut through a sentence.

    Report a bug or suggest a feature →