Token Splitter
The Token Splitter node in n8n divides text into chunks based on token count rather than character count. This distinction matters because large language models process and bill by tokens, not characters. By splitting on token boundaries, you get precise control over how much content you send to an AI model in each request, which directly affects both cost and output quality.
Token-based splitting is essential when building retrieval-augmented generation (RAG) pipelines, processing long documents through AI models, or preparing text for embedding generation. If you split by characters, you might accidentally cut through the middle of a token, which can produce garbled embeddings or incomplete context. The Token Splitter avoids this by respecting the tokenisation rules of the model you are targeting.
This node works hand-in-hand with vector store nodes and summarisation chains. You feed it a long document, it breaks it into token-counted chunks with configurable overlap, and each chunk flows downstream for embedding, summarisation, or classification. The overlap setting ensures important context at chunk boundaries is not lost, which improves retrieval accuracy in search-based workflows.
If your team is building AI workflows that process documents and you need help getting the chunking strategy right, our AI consultants can advise on the best approach for your specific data types and use cases. Chunking strategy has a measurable impact on the quality of custom AI systems.