Text Splitter
Paste your text, choose whether to split by characters, words, lines or a delimiter, set the size of each part, and copy the parts, separated by empty lines or a --- line.
0 words 0 characters 0 lines
Continue with this text: Character counterWord counterRemove line breaks
Your text stays in your browser: nothing is uploaded or stored on a server.
How to split text
- Paste your text in the box, open a plain-text file with Open file, or press Example to try the sample.
- Pick a mode in Split by: Characters (keeps words whole), Words, Lines or A delimiter.
- Enter the Size of each part (for the first three modes) or the Delimiter (for the last one).
- Choose what goes Between parts (an empty line, a line break or a
---line) and tick Number the parts (1/5) if you want numbering. - The result and the number of parts update as you type. Press Copy or Download .txt, or Use as input to split the result again.
The four ways to split
| Split by | What Size means | Where parts break | Keeps line breaks? |
|---|---|---|---|
| Characters (keeps words whole) | Most characters per part, spaces included | At the last space that fits | No |
| Words | Words per part | After every Size words | No |
| Lines | Lines per part | After every Size lines | Yes, inside each part |
| A delimiter | Ignored | At every copy of the delimiter | Yes, inside each piece |
In Characters and Words mode the text is first broken into words at spaces, tabs and line breaks, then rebuilt with a single space between words. Paragraph breaks, tabs and double spaces therefore disappear, which is what you want for posts and messages but not for structured text. To keep the layout, split by Lines or by a delimiter such as \n\n (an empty line).
Rules and edge cases
- Character count. A part’s length counts letters, spaces and punctuation. Most emoji count as 2, as they do on X. So
Hello world 👋 againwith size 13 givesHello worldand👋 again, becauseHello world 👋would be 14. - Words longer than the size are cut at the size, so a long link may end up across two parts:
https://example.com/a-very-long-pathwith size 15 giveshttps://example,.com/a-very-lonandg-path. Cuts always fall between characters, so an emoji, flag or accented letter is never split; when the next character would not fit, the part is a little shorter than the size. - Trimming. Every part has spaces and line breaks removed from its start and end, and empty parts are dropped. With Lines that also removes the indent on the first line of a part.
- Empty lines count as lines in Lines mode. A part made only of empty lines is dropped, so the number of parts can be lower than lines ÷ size.
- Delimiters are matched exactly, case and spaces included, and removed from the output.
\nmeans a line break. Windows, Mac and Unix line endings are all treated as line breaks in Lines mode. - Numbering adds
(1/5)to the end of each part. In Characters mode the splitter reserves room for the suffix, so every numbered part, suffix included, fits the size: 200 copies ofwordat size 280 give four parts of 280, 280, 280 and 180 characters. Reserving that room can add a part. In Words and Lines mode the size counts words or lines, so the suffix simply goes on the end. With numbering on and a very small size, the suffix leaves little room, so words are cut into short pieces:one two three fourat size 9 givesone (1/6),two (2/6),thr (3/6),ee (4/6),fou (5/6)andr (6/6). When the suffix cannot fit at all (size 7 or less in that example), the splitter keeps words whole, numbers the plain split (one two (1/3),three (2/3),four (3/3)) and warns that the size is too small to fit the (n/N) numbers, so the numbered parts are longer than the size. Use a larger size or turn numbering off. - Size is a whole number of at least 1; decimals are rounded down.
Worked examples
By characters, size 20, Line break between parts, numbering on. Each part, with its number, is at most 20 characters, which takes four parts instead of three:
Before:
The quick brown fox jumps over the lazy dog.
After:
The quick (1/4)
brown fox (2/4)
jumps over the (3/4)
lazy dog. (4/4)
By words, size 3:
| Before | After (empty line between parts) |
|---|---|
one two three four five six seven |
one two three · four five six · seven |
By lines, size 2, numbering on:
Before:
apple
banana
cherry
date
elderberry
After:
apple
banana (1/3)
cherry
date (2/3)
elderberry (3/3)
By delimiter ;: red; green;; blue ; becomes red, green and blue, three parts, because the empty piece between ;; and the one after the last ; are dropped and spaces around each piece are trimmed.
When people need it
- Threads on X. X counts up to 280 characters per post, with every link counted as 23 characters and emoji and Chinese, Japanese or Korean characters as 2 each. Our splitter counts links at their full length, so a post with a long link has room to spare once posted. Check any part you are unsure about with the character counter; other platforms’ limits are in the character limits cheat sheet.
- Long SMS messages. A single text message holds 160 GSM-7 characters, but a long message is sent in segments of 153 characters each. One emoji or other non-GSM character switches the message to UCS-2, where segments hold 67 characters. Use 153 or 67 to see where the segments break.
- Word-limited form fields. Split a long answer into 250-word parts with Words, then edit each one.
- Batches of a list. Split 1,000 email addresses or product IDs into groups of 100 with Lines, for tools that accept a limited number of rows at a time. Count the list first with the line counter.
- Pasting a document into a chatbot. Split by characters or by paragraphs (delimiter
\n\n) to send a long text in pieces. - Breaking up an export. A delimiter such as
---or;turns one long string into one record per part. Text copied from a PDF usually needs its stray line breaks fixed first; see removing line breaks from PDF text.
Splitting into spreadsheet columns instead
This tool gives text back, one part after another. If you want each piece in its own cell, do it in the spreadsheet. Excel’s Text to Columns wizard splits a column at a delimiter, and the TEXTSPLIT function, in Microsoft 365 and Excel 2024, does the same as a formula: =TEXTSPLIT(A1, ","). Google Sheets has =SPLIT(A1, ","), which drops the delimiter and, by default, empty pieces. To go the other way and join a column into one comma-separated line, use the comma separator.
Questions
Does the splitter ever cut a word in half?
Only when a single word is longer than the size you set, such as a long URL in a 15-character split. Then the word is cut at the size, always between two characters so an emoji or accented letter is never broken, and the rest starts the next part. Otherwise every part ends at a space.
How do I split text into a Twitter or X thread?
Choose Characters (keeps words whole), enter 280, and tick Number the parts (1/5) if you want numbering. In Characters mode the splitter keeps room for the " (1/5)" suffix, so each numbered post, number included, stays within 280 characters.
Can I split text by word count?
Yes. Choose Words and enter the number of words per part. A word is anything between spaces, tabs or line breaks, so "well-known" is one word and a lone dash is one word too.
Can I split text at a comma, semicolon or other character?
Choose A delimiter and type it in the Delimiter field. It can be several characters, such as ", " or "---", and \n stands for a line break. The delimiter is removed and empty pieces are dropped.
How do I split text into columns in Excel or Google Sheets?
This tool puts each piece on its own line, not in cells. In a spreadsheet, use Excel's Text to Columns wizard or its TEXTSPLIT function (Microsoft 365 and Excel 2024), or SPLIT in Google Sheets. To turn a column back into one line, use the comma separator.
Is this a LangChain-style text splitter for AI prompts?
It splits by characters, words or lines, which works for pasting a long document into a chatbot part by part. It does not count tokens and has no overlap between parts, so for an AI pipeline use the splitter in your code library.
Is my text uploaded?
No. The splitting runs in your browser, and the text stays in this tab.