More games at WuGames.ioSponsoredDiscover free browser games — play instantly, no download, no sign-up.Play

Text Splitter

Split text by any delimiter, character count, word count, line count, sentence, or paragraph. Number chunks, trim whitespace. Free, browser-side privacy.

settings Settings

About Text Splitter

Text Splitter breaks input text into ordered chunks using one of seven strategies: literal delimiter (any string you supply, including escape sequences like \t or \n), fixed character count, fixed word count (whitespace-delimited tokens), fixed line count, sentence boundary (end-of-sentence punctuation . ! ? followed by whitespace), paragraph boundary (one or more blank lines as separators), and full custom string. Each strategy is implemented as either String.prototype.split() with the appropriate separator, or a sliding window for size-based splits. Options apply to all modes: 'Trim Whitespace' calls String.trim() on each chunk before output, 'Remove Empty Chunks' filters out zero-length results (useful when delimiters appear back-to-back like ',,'), and 'Number Chunks' prefixes each output piece with '1. ', '2. ', etc. The output separator controls how chunks are joined for display — double newline gives clear visual separation, comma-space gives CSV-style output, dashes give a visible divider. Typical workflows: split SMS message bodies into 160-char chunks for multi-part delivery, break a long article into tweet-sized 280-char fragments for X/Twitter threads, chunk text for LLM context windows (e.g., 4096-token boundaries via word count), split CSV pasted as a single cell into rows, separate concatenated log entries by timestamp delimiter, and process bulk imports where one input represents many records.

How is character-count splitting different from word-count and which should I use for SMS or tweets?

Character-count splits at exact byte/UTF-16 code-unit boundaries — chunk 3 stops at character 480 even if that lands mid-word. Word-count splits on whitespace tokens, so 'hello world foo' with chunk 2 yields 'hello world' + 'foo'. For SMS (160 GSM-7 chars or 70 UCS-2 chars for emoji), use character-count to avoid overflow. For tweets (280 chars, but Twitter counts emoji as 2), character-count works but you should add a 'continued (1/3)' marker via Number Chunks. For LLM context windows (token-based, ~4 chars per token in English), word-count is closer to reality.

Does sentence splitting handle abbreviations like 'Dr.' and 'Mr.' correctly?

Partial — the regex uses a heuristic that splits at '. ', '! ', or '? ' followed by uppercase. This correctly handles most prose but mis-splits at 'Dr. Smith', 'U.S.A.', '3.14 is', and 'Mr. Brown said'. For research-grade sentence segmentation use a dedicated NLP tool (spaCy, NLTK, or HuggingFace tokenizers). For casual splitting of blog posts, articles, or transcripts the heuristic works ~95% of the time. If you have a known abbreviation pattern, replace it with a placeholder first ('Dr.' → 'Dr@') using Word Replacer, split, then restore.

What does paragraph splitting consider a paragraph break?

One or more empty lines (matched by regex /\n\s*\n+/) acts as the paragraph boundary. So 'para one\n\npara two' yields two chunks. Single line breaks within a paragraph are preserved as part of the same chunk. This matches markdown convention and Word's Enter-Enter paragraph behavior. If your input uses Word-style '\r\n\r\n' on Windows, it still works because \r is whitespace. If you have no blank lines, paragraph mode returns the whole input as one chunk — use line-count splitting instead.

Text Splitter — Split text by any delimiter, character count, word count, line count, sentence, or paragraph. Number chunks, trim whites
Text Splitter

Can I use special characters like tab or newline as a delimiter?

Yes — type escape sequences directly: \t for tab, \n for newline, \r for carriage return, \u00A0 for non-breaking space. The tool interprets them at parse time. For a literal backslash type \\. To split on a regex pattern (not a literal string), use the Word Replacer tool first to substitute your regex matches with a unique marker like '@@SPLIT@@', then split here on '@@SPLIT@@'. This two-step approach gives full regex power without complicating the splitter UI.

What does 'Trim Whitespace' actually do to chunks with internal spaces?

It strips only leading and trailing whitespace from each chunk, preserving internal spaces. So 'hello world ' becomes 'hello world' (trimmed at ends, the double space in the middle stays). This matches JavaScript String.trim() and Python str.strip() behavior. To collapse internal whitespace too, run the output through Text Cleaner afterwards. Trim is particularly useful with delimiter-based splits where one delimiter character may include a trailing space (', '), leaving stray spaces at chunk boundaries.

Why might 'Remove Empty Chunks' return fewer chunks than I expect?

Empty chunks arise when delimiters appear consecutively (',,' yields '', '', between them), when input starts or ends with a delimiter (',a,b' yields '', 'a', 'b'), or when fixed-size mode hits exactly-empty boundaries. With Remove Empty enabled, the filter drops all zero-length chunks before output. If you want to preserve them (e.g., representing missing CSV columns where empty means null), disable the option. The Total Chunks counter shows the post-filter count, not the raw split count.

Is splitting performed in the browser and is my text private?

Yes, all splitting runs in JavaScript via String.split() and array map/filter — no fetch() to a server, no analytics with content, no localStorage write. Open the DevTools Network tab and click Split to verify zero outbound requests. This makes the tool safe for splitting confidential text like internal documents, customer PII, source code with proprietary logic, or pre-publish drafts under embargo. Even 10 MB inputs split client-side in well under a second.