RAG text chunker
Split a long document into overlapping chunks for retrieval and embeddings. Choose tokens, characters, words or sentences, set the size and overlap, and copy the chunks, all in your browser.
Files are processed in your browser and never uploaded.
How to use RAG text chunker
Add your text
Type or paste your text into the input box. Everything is handled by your own browser, so nothing is sent to a server.
Set the options
Choose Split by, Chunk size and Overlap. The options are visible from the start, not hidden until you paste something.
Read it and keep a copy
The output updates as you type, so there is nothing to submit and nothing to wait for. Copy all as JSON puts the result on your clipboard.
What this tool does
Split by tokens, characters, words or sentences
Split by tokens, characters, words or sentences, because a chunker that only counts characters cuts sentences in half.
Set chunk size and overlap
Chunk size and overlap are both yours to set, and overlap is what stops an answer being lost across a boundary.
Token splitting uses the GPT-4o tokenizer
Token splitting uses the GPT-4o tokenizer, so the counts match what the model will actually charge you for.
Copy all chunks as JSON or as text
Copy every chunk as JSON for a pipeline, or as plain text when you are pasting them somewhere by hand.
Runs in your browser, nothing uploaded
The document is split in your browser, which matters because the documents worth chunking are usually the private ones.
Frequently asked questions
Is my text uploaded anywhere?
No. The text is split into chunks entirely in your browser. Nothing you paste is sent anywhere or stored.
What does chunking do and why overlap?
It breaks a long document into smaller pieces for retrieval augmented generation, so each piece can be embedded and searched. Overlap repeats a little of the previous chunk at the start of the next, so a sentence split across the boundary is not lost.
What can I split by?
Tokens, characters, words or sentences. Tokens are usually best for fitting an embedding model's limit, while sentences keep chunks readable and avoid cutting mid-sentence.
How accurate is the token splitting?
It uses the GPT-4o tokenizer, which is a close approximation for most models since there is no public tokenizer for Claude or Gemini. It is well within range for planning chunk sizes.
How do I get the chunks out?
Copy all as JSON gives an array of strings ready to drop into code, and copy all as text gives the chunks separated by a divider. Both include every chunk, not just the ones shown.
Last updated: