What a text splitter does
A text splitter cuts one long piece of text into smaller pieces. You choose where the cuts fall: after a number of characters, words or lines, or at every comma, semicolon or other delimiter. The result is a set of parts you can use one by one.
Common jobs are fitting a long message into a limit, such as a chat box or an SMS field, turning a one-line list into a column, breaking a long script into sections and shortening very long lines for a plain-text email. The size you enter is the maximum, so a part can be shorter but never longer.
A worked example
Splitting this sample at 100 characters, with labels on and a blank line between parts:
[Part 1 of 3]
A text splitter cuts a long piece of writing into smaller parts. People use it to fit a long prompt
[Part 2 of 3]
into a chat limit, to break a script into scenes, or to turn one long line into a column.
This
[Part 3 of 3]
sample is split at 120 characters. Words stay whole, so no part ends in the middle of a word.Each part is 99 characters or fewer, and every cut fell on a space. Part 2 holds a paragraph break because the tool counts characters, not sentences.
Split text by characters, words or lines
- Characters per part: each part holds at most the number you enter. A line break counts as one character. An emoji counts as two, because browsers store it as two code units, but it is never cut in half.
- Words per part: each part holds that many words and keeps the spacing and line breaks that were between them.
- Lines per part: each part holds that many lines. Empty lines count as lines. Windows line endings are treated as normal line breaks.
With Do not cut words ticked, a cut that would land inside a word moves back to the last space. The space is dropped from the end of one part and from the start of the next. A single word longer than the size, such as a long web address, is cut at the size, because the limit is a hard one.
Split text by delimiter
Choose A delimiter to split at every comma, semicolon, period, pipe or any text you type. Each piece goes on its own line. Type \n for a line break and \t for a tab.
Splitting red; green;;blue ; at a semicolon gives:
red
green
blueTrim and skip empty pieces removed the spaces and the two empty pieces. Untick it when empty pieces matter, for example when the position of each field counts. To go the other way and join lines into one, use List to Comma Separated. To put quotes or a prefix around every piece afterwards, use Add Text to Each Line.
Wrap lines at a width
Wrap lines at a width does what word wrap does in an editor. Every line longer than the width is broken at a space, and your own line breaks are kept. Wrapping the sample at 50 characters gives:
A text splitter cuts a long piece of writing into
smaller parts. People use it to fit a long prompt
into a chat limit, to break a script into scenes,
or to turn one long line into a column.
This sample is split at 120 characters. Words stay
whole, so no part ends in the middle of a word.Lines that already fit are left exactly as they are. If you need the opposite and want to join wrapped lines into paragraphs, use Remove Line Breaks. For comment, quote and list prefixes that stay on every line, a width ruler and rejoining old line breaks, use Word Wrap.
Split a long prompt into chunks for ChatGPT
Chat tools limit how much you can paste at once. To send a long text in pieces, split it by characters, tick Add Part 1 of N labels and paste one part at a time. The labels tell the chat how many parts to expect.
This tool does not call any chat service. It only prepares the text, and you paste the parts yourself.
Splitting text in Excel and in code
To split a cell in Excel, use Data, then Text to Columns, or the TEXTSPLIT function in current versions. This page is for text that is not in a sheet yet. Paste the cell contents here, split them, and paste the result back.
In Python, splitting at a delimiter is one call:
"red; green;;blue".split(";")Splitting into fixed-size chunks needs a short loop. If you want to see what the right result looks like first, run the same text through this page.
Limits
- Cuts fall on spaces, not on sentences or paragraphs. The tool does not try to understand meaning.
- Characters are counted as UTF-16 code units, the way JavaScript counts. A letter with a separate combining mark counts as two and could be separated from its mark when Do not cut words is off.
- Languages written without spaces between words, such as Chinese or Japanese, split only at the size you enter, because there are no spaces to cut at.
Splitting happens in your browser. What you paste is not uploaded or stored. See the Privacy Policy for details.