New blogMaking an AI Agent You Can Trust With Money

★ Recursive chunking, visualized

Recursive Chunking for RAG

Recursive splitting tries separators in order: blank lines, then line breaks, then sentence ends, then spaces, then single characters. It uses the first separator that appears, packs the pieces into chunks up to the size limit, and recurses into any piece that is still too big with the next separator.

  • Runs in your browser
  • No signup

1,181 characters · loading tokenizer… · nothing leaves your browser

chars
chars

Recursive · 300 chars · overlap 40

6 chunks

52
avg tokens
29 / 71
min / max
15
overlap tokens
$6.20
embed 1M docs

Loading the tokenizer; token counts are estimates until it's ready.

# Refund policy for annual plans Annual plans are billed once a year, up front. This page explains when you can get money back and how long it takes. ## Eligibility You can request a full refund within 30 days of the first annual charge. After 30 days, refunds are prorated for the unused months, minus any discount you received for paying annually. Renewals follow the same rule: the 30-day window starts again on each renewal date. ## How to request a refund Open Settings, then Billing, and choose "Request refund". Pick the reason that fits best. If you are cancelling because of a bug, include the error message; it often gets fixed faster than the refund is processed. ### Processing times Card refunds usually appear within 5 to 10 business days, depending on your bank. Bank transfers can take longer. We send an email when the refund leaves our side. ## Exceptions Refunds are not available for usage-based charges such as extra API calls or storage, because those costs are incurred when you use them. Accounts closed for abuse are not eligible. ## Contact Still stuck? Email the billing team with your account ID and the last four digits of the card on file.

one chunkoverlapClick a chunk to inspect it.

Chunk inspector

Click any coloured chunk in the document to see its text, size, heading path and what it shares with its neighbours.

Chunk sizes

Tokens per chunk (estimated). A tight cluster means predictable chunks.

12913724553161169chunk size (tokens), bucket start

Embedding cost assumes text-embedding-3-small at $0.02 per 1M tokens (OpenAI, checked 8 Nov 2026), counting overlap twice.

Export config

Copy-ready code for the strategy and settings above. Comments flag where a library differs.

from langchain_text_splitters import RecursiveCharacterTextSplitter

splitter = RecursiveCharacterTextSplitter(
    chunk_size=300,
    chunk_overlap=40,
    separators=["\n\n", "\n", ". ", " ", ""],
    keep_separator="start",
)
chunks = splitter.split_text(text)

Your retrieval is only as good as your chunks.

I build RAG systems with evals, so you know when the answers get better or worse.

Fix my RAG
01

How it works

Recursive splitting tries separators in order: blank lines, then line breaks, then sentence ends, then spaces, then single characters. It uses the first separator that appears, packs the pieces into chunks up to the size limit, and recurses into any piece that is still too big with the next separator.

This tool follows LangChain's RecursiveCharacterTextSplitter: separators are kept at the start of the following piece, overlap is built by dropping pieces from the front of the previous chunk, and whitespace is trimmed from each chunk.

Source: LangChain's RecursiveCharacterTextSplitter.

02

When to use it

Good fit

  • The default for most text documents: help centres, docs, articles, policies.
  • When you want chunks that end at paragraph or sentence boundaries where possible.
  • When you need a size limit but don't want to cut through every sentence.

Watch out for

  • Chunks lose the heading they sit under, so 'Eligibility' text can float free of its topic.
  • Separators are kept at the start of the next chunk, so with '. ' a chunk can begin with a full stop.
  • Long unbroken text (minified code, tables) falls through to character splitting.
03

Where to start

Start with a size that fits one or two paragraphs and a small overlap. If answers need the section title, add it to each chunk or move to markdown-aware splitting.

Then test it: write down twenty real questions, check which chunks come back for each, and compare strategies on the same set. The main visualizer lets you put two strategies side by side.

04

Questions engineers actually ask

Why does a chunk start with a full stop?
LangChain keeps the separator at the start of the next piece by default. With '. ' as a separator, the full stop travels with the next sentence. Switch the separator position to 'end' to keep it with the sentence it belongs to.
Which separators should I use?
Blank line, line break, sentence end, space, then nothing is a good general order. For code, add language-aware separators such as class and function boundaries.
Does it match LangChain exactly?
The algorithm follows LangChain's source for RecursiveCharacterTextSplitter. Counting tokens instead of characters depends on the tokenizer, so token sizes can differ slightly from your setup.
What chunk size should I use for RAG?
There is no universal number. A few hundred tokens with a small overlap is a common starting point, but the right size depends on your documents and questions. Build a small evaluation set and compare sizes on it.
Does my text leave the browser?
No. Splitting, tokenizing and the visualization all run in your browser. Nothing you paste is sent anywhere.
05

Other strategies

06

More from the workbench

Fine print

Tools: on the house.
Engineer: by the hour.

The visualizer was free. Production RAG with evals is what I build.

I'm Himanshu, an AI and full-stack engineer. I build MVPs, AI agents and the growth plumbing around them for early-stage startups.