Text Splitter
Break long text into copy-ready chunks without cutting through words when possible. Choose any maximum character length and keep the original order. Everything runs locally in your browser.
Split long text into smaller chunks with a chosen maximum character length. The splitter tries to break at a nearby line ending first, then at a space, and falls back to a hard character cut when no suitable boundary is available.
How to split text into chunks
- Paste the long text you want to divide.
- Enter a positive whole-number maximum length for each chunk.
- Run the splitter.
- Review the numbered chunks and their boundaries.
- Copy the complete chunked result if needed.
How chunk boundaries are chosen
For each chunk, the splitter first looks backward for a newline before the maximum length. If that newline is earlier than half of the allowed length, it instead looks for a space. If neither boundary appears in the latter half of the target range, it cuts exactly at the maximum length.
Leading and trailing whitespace around chunk boundaries is trimmed so chunks do not begin or end with leftover separator spaces. The configured maximum is measured with JavaScript string length, which is based on UTF-16 code units rather than user-perceived grapheme clusters.
Privacy and limitations
Splitting is performed locally in the browser and the text is not intentionally uploaded. The tool aims for convenient boundaries but does not understand sentences, paragraphs semantically, token limits for a specific AI model, or grapheme clusters. Some emoji and rare characters can occupy more than one JavaScript code unit.
Frequently asked questions
Will every chunk be exactly the maximum length?
No. The tool prefers a nearby newline or space when a suitable boundary exists.
What happens if there is no space or newline nearby?
It makes a hard cut at the configured maximum length.
Does it preserve whitespace at chunk edges?
Boundary whitespace is trimmed with trimEnd and trimStart as chunks are created.
Can I use zero as the maximum length?
No. The maximum must be a positive integer.
Is this the same as splitting by AI tokens?
No. The limit is JavaScript string length, not tokenizer-specific token count.