Character Text Splitter
The Character Text Splitter breaks long documents into smaller, equal-sized pieces. Think of it like cutting a long article into pages - each piece is roughly the same size, making it easier for AI to process and understand.
This is the simplest way to prepare documents for AI workflows. While other splitters use smart rules, this one just counts characters and splits at regular intervals.
How it works
Section titled “How it works”The splitter takes your text and divides it based on character count. You can choose where it prefers to split (like at paragraph breaks) and how much overlap you want between pieces to maintain context.
graph LR
Text[Long Document] --> Splitter{Character Splitter}
Splitter --> Chunk1[Chunk 1]
Splitter --> Chunk2[Chunk 2]
Splitter --> Chunk3[Chunk 3]
style Splitter fill:#6d28d9,stroke:#fff,color:#fff
Setup guide
Section titled “Setup guide”- Connect Your Text: Provide the document you want to split. This usually comes from a “Get All Text From Link” or similar node.
- Set Chunk Size: Choose how many characters each piece should contain (typically 500-1500 characters).
- Choose Split Points: Decide where to split - at paragraph breaks (“\n\n”) works well for most documents.
- Add Overlap: Set how many characters should overlap between chunks to maintain context (usually 100-200 characters).
Practical example: Research article processing
Section titled “Practical example: Research article processing”Let’s say you want to process a long research article for AI analysis.
Input Configuration:
- Chunk Size: 800 characters per piece.
- Separator: Split at empty lines (
\n\n) to keep paragraphs together. - Overlap: 100 characters to keep context.
Resulting Split:
- Chunk 1: “Introduction… (content)…” (Length: 800 chars)
- Chunk 2: ”…(overlap from chunk 1)… Methodology…” (Length: 800 chars)
Total: 2 chunks created from the article.
Common settings
Section titled “Common settings”| Setting | Purpose | Recommended Value |
|---|---|---|
| Chunk Size | How many characters per piece | 800-1200 for most documents |
| Separator | Where to prefer splitting | ”\n\n” for paragraphs, “\n” for lines |
| Chunk Overlap | Characters shared between chunks | 100-200 to maintain context |
When to use this splitter
Section titled “When to use this splitter”Perfect for:
- Simple document processing workflows
- When you need consistent chunk sizes
- Processing plain text documents
- Getting started with AI text analysis
Consider alternatives for:
- Complex documents with varied structure
- When you need to respect semantic boundaries
- Processing code or structured data
Troubleshooting
Section titled “Troubleshooting”- Chunks too small: Increase the chunk size or check if your separator appears frequently in the text
- Important information split: Increase chunk overlap or use paragraph separators (“\n\n”) instead of sentence separators
- No splitting occurs: Make sure your separator actually exists in the text, or try a simpler separator like ” ” (space)