Text Separator

Use the text separator to split text into separate items and join them again with a different separator. Turn a comma-separated list into one item per line, lines into a CSV row, spaces into commas, or anything into anything – including tabs, pipes, custom text and regular expressions. Optional cleaning trims spaces, removes empty items and duplicates, sorts the list and wraps each item in quotes. Everything happens in your browser.

  • 100% free
  • No sign-up
  • Private & local
  • Works on mobile

Private by design: every calculation runs locally in your browser. Nothing you type is sent to a server or stored by us.

What the Text Separator Does

Lists come in many shapes: comma-separated values from a spreadsheet, one item per line from a document, tags separated by spaces, or IDs joined by pipes. The text separator converts between all of them in two steps. First it splits the text wherever the chosen separator appears, giving a list of items. Then it joins the items again with the separator you pick for the output. Between those steps it can clean the list: trim stray spaces, drop empty items, remove duplicates and sort alphabetically.

How to Use It

  1. Paste your text into the input box, or click "Sample" to try an example.
  2. Choose "Split by" – the character that currently separates the items, for example a comma.
  3. Choose "Join with" – the separator you want in the result, for example a new line.
  4. Pick cleaning options such as trimming, removing duplicates or sorting. The result updates instantly.
  5. Copy or download the result.

Common Conversions

TaskSplit byJoin with
Comma list → one per lineCommaNew line
Column of cells → CSV rowNew lineComma
Words → hashtagsSpaceSpace, with prefix #
List → SQL IN (…) valuesNew lineCustom , , wrapped in single quotes
Spreadsheet row (tabs) → commasTabComma
Text → separate charactersEvery characterSpace

Example: the input apple, banana, cherry, date, , apple, fig split by comma and joined with new lines gives seven items. With "Trim" and "Remove empty items" turned on, the blank item disappears and the extra spaces before "date" are removed. With "Remove duplicates", the second "apple" goes too, leaving five items.

Custom Separators and Regular Expressions

Choose Custom… to use any text as a separator, such as / , - or a word. Type \n for a new line and \t for a tab. For advanced splitting, tick "Custom separator is a regular expression": for example [,;]\s* splits on both commas and semicolons, and \s+ splits on any run of spaces, tabs and line breaks.

Tips

  • Repeated separators such as double commas create empty items. Either keep "Remove empty items" on, or tick "Treat repeated separators as one".
  • Quotes inside items are escaped with a backslash when you wrap items in the same kind of quote, so the output stays valid for code.
  • Sorting is natural, so "item 2" comes before "item 10", and it ignores upper and lower case.
  • Big lists of thousands of lines are fine – everything runs locally and instantly.

Only need to clean a list that's already one item per line? Try remove duplicate lines or sort lines alphabetically.

Practical Examples

  • Email lists: paste addresses copied from a spreadsheet column (one per line) and join them with "; " to paste into the To field of Outlook, or with ", " for Gmail.
  • Code and data: turn a list of IDs into a JavaScript array or SQL list by joining with ", " and wrapping each item in quotes, then add the brackets around the result.
  • Hashtags and keywords: split a comma-separated keyword list and join with spaces, using the prefix # – remove spaces inside items first if a tag has several words.
  • File names: add a suffix such as .jpg to a list of product codes to build file names for a bulk upload.
  • Spreadsheet import: convert pipe- or semicolon-separated exports into tab-separated text, which pastes into separate cells in Excel and Google Sheets.

Tip: when splitting by space, several spaces in a row are always treated as one separator, so text that was aligned with extra spaces still splits cleanly into the right items.

Frequently Asked Questions

How do I separate words with commas?

Choose "Split by: Space" and "Join with: Comma". Each word becomes an item, and the items are joined with commas.

How do I put each comma-separated item on a new line?

Choose "Split by: Comma" and "Join with: New line", and keep "Trim spaces around items" on.

Can I split by more than one character?

Yes. Choose "Custom…" and type any text, or tick the regular expression option to split by patterns such as several different symbols.

How do I add quotes around every item?

Use "Wrap each item in" and choose double quotes, single quotes or backticks.

Does it count the items?

Yes. The number of items in the result is shown below the options.

Is my text uploaded?

No. The text is processed in your browser and never sent anywhere.