Glossary

Text splitter

A component that breaks long text into smaller chunks of a set size, using separators, sentences, tokens or document structure, so each chunk can be embedded and retrieved.

A text splitter is the component that cuts long text into smaller pieces, called chunks, before they are embedded and indexed for retrieval augmented generation. It takes the output of a document loader, applies a rule for where to break the text and how large each piece may be, and returns a list of chunks, usually with the source metadata copied onto each one. Because the splitter decides what a single search result can contain, it has a large effect on search relevance.

Why text needs splitting

Three limits force it. Embedding models accept a maximum input length and cut off anything beyond it. A single vector for a long document averages many topics together, so it matches no specific question well. And the language model has a finite context window, so the application can only pass it a handful of passages. Splitting turns a 40-page manual into a few hundred focused chunks, each with its own embedding, and lets the retriever return just the parts that matter. The general practice is covered under chunking; the splitter is the code that carries it out.

Types of text splitters

Splitter

Where it breaks

Good for

Character

A single separator, such as a blank line

Simple, uniform text

Recursive character

Paragraphs, then lines, then words, until chunks fit

Most prose; the usual default

Token

Exact token counts from a tokenizer

Staying under model input limits

Sentence

Sentence boundaries, grouped up to a size

Readable chunks for answers and citations

Structure-aware

Markdown or HTML headings, code syntax

Documentation, code and web pages

Semantic

Where similarity between neighbouring sentences drops

Long text that shifts topic

The recursive splitter is the default in many frameworks because it tries the largest natural unit first and only falls back to smaller ones when a piece is still too big. Semantic chunking uses an embedding model to find topic changes, which costs more at indexing time, and published evaluations have found it no better than recursive splitting on many corpora; semantic vs recursive chunking sets out the trade-offs. Token splitters measure length with the model’s own tokenization, so a chunk of 512 tokens is exactly that.

Chunk size, overlap and length

Every splitter takes a chunk size and a chunk overlap, and the unit matters. LangChain’s splitters measure length in characters by default, with a chunk size of 4,000 and an overlap of 200, though you can pass a token counter instead. LlamaIndex’s sentence splitter counts tokens, defaulting to 1,024 with an overlap of 200. Many teams start around 256 to 512 tokens with 10 to 20 percent overlap and adjust after testing. Smaller chunks give sharper matches but less context per hit; larger ones keep context but dilute the embedding and spend more of the prompt.

Most splitters also copy the source metadata onto every chunk and can record each chunk’s position in the original text. That position makes source attribution possible and lets parent document retrieval and sentence window retrieval expand a hit back to its surroundings. Late chunking changes the order instead, embedding the whole document before applying the splitter’s boundaries.

Choosing a text splitter

Match the splitter to the structure you have. Markdown and HTML documentation split well on headings, code on functions and classes, and transcripts on speaker turns or time. For general prose, a recursive splitter with a modest overlap is a sound starting point. Then measure: build a small golden dataset of real questions, check recall@k for each configuration, and change one setting at a time. Retrieval evaluation covers the method.

Text splitters and Exabase

Deep Search indexes everything stored as Resources without a splitter for you to configure. There is no chunk size, overlap or separator list, and results come back as passages located by page number or timestamp, with a precision setting to trade recall for relevance. Exabase does not publish which splitting method it uses internally. When you need chunks for your own pipeline, Extract returns a file’s text as ordered chunks with page numbers or timestamps, the retrieving results guide explains how to page through them, and the PDF to chunks tool handles single PDFs.

RAG accuracy explains why tuning chunk size has limits, Chunking is a workaround, not a design makes the longer argument, and the knowledge bases use case shows a maintained index in practice. Exabase vs LangChain compares the managed approach with framework splitters.

FAQs

What is a text splitter?

A text splitter breaks long text into smaller chunks so each can be embedded and retrieved on its own. It sets where the breaks fall and how large each chunk may be.

Which text splitter should I use?

A recursive character splitter suits most prose, and structure-aware splitters suit Markdown, HTML and code. Choose by testing retrieval on real questions rather than by default.

What chunk size should a text splitter use?

Many pipelines start between 256 and 512 tokens with 10 to 20 percent overlap. The right size depends on the content and the questions, so measure before settling.

What is the difference between a text splitter and a tokenizer?

A tokenizer turns text into the tokens a model reads. A text splitter groups text into chunks, and token-based splitters use a tokenizer to measure chunk length.

Does a text splitter keep metadata?

Most do. Frameworks copy the source document’s metadata onto every chunk, and many can also record each chunk’s start position in the original text.

Do I need a text splitter with Exabase?

No. Deep Search indexes stored content automatically and returns matching passages, so there is no splitter to configure unless you build your own pipeline on Extract output.

Related pages: Chunking, Chunk overlap, Document loader, Recursive chunking, Semantic chunking, Semantic vs recursive chunking, Late chunking, Tokenization, Deep Search, RAG accuracy.

Cut your token spend and give your agent precise context.

Get started in minutes.

Cut your token spend and give your agent precise context.

Get started in minutes.