Split text at commas, pipes or a pattern — one item per line

Paste a line such as "apple, banana, cherry", pick what to split on, and the tool puts every piece on its own line, trimmed and with empty pieces dropped.

Live demo · real result from this tool

One item per line

apple banana cherry date

Processed on your device — nothing is uploaded.

How to use the text splitter

  1. Paste your text into Your text.
  2. Choose Split on: comma, semicolon, pipe, tab, spaces, full stop, Custom text or Regular expression.
  3. For the last two, type the delimiter or pattern in Custom delimiter.
  4. Keep Trim each item and Drop empty items ticked for a clean list. The result appears under One item per line as you type.

What it does and when to use it

Data often arrives squeezed into one line: tags in a CMS field, a list of email recipients, values copied from a URL, a row of a CSV file. The splitter turns that line into a vertical list you can sort, count, de-duplicate or paste into a spreadsheet column.

Pick the option that matches how the data is glued together:

  • Comma , or Semicolon ; for lists from forms and exports.
  • Pipe | or Tab for log lines and data copied from a table.
  • Spaces to put every word on its own line.
  • Full stop . for quick splits of short phrases. For real prose, the sentence splitter is better because it understands abbreviations and decimals.
  • Custom text for any multi-character delimiter, such as “ - “ or “::”.
  • Regular expression when the separator varies.

After splitting, the text sorter and remove duplicates tools work well on the list.

How it works

The tool cuts the text at every match of the chosen separator. Custom text is matched exactly as typed, with \n and \t read as a line break and a tab. Regular expressions use JavaScript syntax with Unicode mode on. The Spaces option treats any run of whitespace as one break. Then each piece is trimmed (if ticked), empty pieces are dropped (if ticked), and the pieces are joined with line breaks. Nothing leaves your browser.

Worked examples

These outputs come from the tool’s own function.

A tag list. apple, banana, cherry, date with the default comma setting gives four lines: apple, banana, cherry, date. Trimming removed the space after each comma.

A multi-character delimiter. step one - step two - step three with Custom text - gives step one, step two, step three. The hyphen inside a word would be left alone because only space-hyphen-space matches.

Messy units. 10 kg, 20kg , 35 kg with the regular expression \s*kg\s*,?\s* gives 10, 20 and 35, one per line. The pattern removes the unit, the comma and any spacing in one step.

Limits and tips

  • The comma option does not understand quoted CSV fields. For a field like "Lee, Sam", use the column extractor, which respects quotes.
  • Splitting on a full stop also splits decimals such as 2.5.
  • If Custom text is left empty, the tool falls back to splitting on commas.

Frequently asked questions

How do I turn a comma-separated list into a column?
Paste it, keep "Comma ," in Split on, and copy the result. Each item lands on its own line, ready to paste down a spreadsheet column.
Why are there no empty lines when my text has two commas in a row?
Drop empty items is on by default, so "red;green;;blue" gives three lines, not four. Untick it to keep a blank line for each empty field.
What does the Spaces option do with double spaces?
It splits on any run of whitespace, including tabs and line breaks, so several spaces in a row count as one break.
My regular expression shows an error. Why?
The pattern must be valid JavaScript regex syntax. An unclosed bracket such as "(" is rejected with a message that names the problem. Characters with special meaning, like . or |, need a backslash to be matched literally.
Can I join the lines back together?
Yes. The line joiner does the reverse and lets you choose the separator and quotes.

Written by the ToolsRift team · Last updated

Pages are drafted with AI assistance and checked by automated tests. How we write and check pages.

Was this tool useful?

Report a problem

Start typing to search every tool.

↑ ↓ to moveEnter to openEsc to close