DevTools Logo

RAG Text Chunker

RAG Text Chunker

Split Markdown or text into retrieval-ready chunks by headings, words or characters — with overlap and metadata, in your browser

    Input

    Try a sample:

    Sections split at heading boundaries; any section larger than the max is further split by characters.

    Have HTML? Convert to Markdown first
    Retrieval-Augmented Generation (RAG) and long-context LLM workflows both depend on splitting documents into chunks that are small enough to embed or rank, yet big enough to keep their meaning. Naive word-count splitters cut a sentence or a code block in half and destroy context. The RAG Text Chunker splits intelligently: a Markdown-header strategy breaks the document at heading boundaries (preserving the heading hierarchy as each chunk's source path), while fixed-word and fixed-character strategies give you deterministic sizes with configurable overlap so adjacent chunks share context at the edges. Every chunk carries metadata — its index, the source heading it came from, and an estimated token count — and you can copy a single chunk, copy them all, or export the full set as JSON ready for an embeddings pipeline. Chunking runs entirely locally in your browser. Have raw HTML? Convert it to Markdown first with the HTML to Markdown tool, then chunk it here.

    Examples

    Split by Markdown headings

    # API Reference
    Base URL: …
    ## Authentication
    Use a bearer token.
    ## Errors
    Returns JSON.
    
    → 3 chunks:
      [0] API Reference
      [1] API Reference > Authentication
      [2] API Reference > Errors

    Each heading starts a new chunk; the source path keeps the hierarchy so retrieval knows where a chunk lived.

    Fixed size with overlap

    Strategy: fixed-words · max 200 · overlap 30
    
    → adjacent chunks share their last/first 30 words, smoothing context transitions.

    Overlap prevents a concept that straddles a boundary from being split across two unrelated chunks.

    Export for embeddings

    [
      { "index": 0, "heading": "Intro", "content": "…", "tokens": 128 },
      { "index": 1, "heading": "Setup", "content": "…", "tokens": 95 }
    ]

    Download the chunks as JSON — index, heading, content and token estimate — ready for a vector database.

    About this tool

    Chunk Markdown or text by headings, words or characters with overlap and metadata for RAG. Export JSON. Free and client-side — no uploads. RAG Text Chunker runs in the browser on DevTools. There is no signup, and your input stays on this device unless the tool explicitly performs a live network lookup.

    What this tool does not do

    • RAG Text Chunker is a free in-browser utility, not a hosted API. It does not keep server-side history and is not a substitute for production verification in your own stack.

    How do I use this tool?

    1. How do I use RAG Text Chunker?

      Open RAG Text Chunker, enter or paste your input, and copy the result. The page works without an account.