Skip to content
cliplimeClipLime

Convert a list between lines, commas and more

Paste a list, choose how its items are separated and how you want them joined, and copy the result.

Your list

0 characters, 0 lines

Convert to

Clean up

Ready made styles

More options

Use \n for a new line and \t for a tab in any of these boxes.

Result

Your list is converted in this tab. Nothing is uploaded.

At a glance

What it does
Turns a list written one way into a list written another way: lines to commas, commas to lines, tabs to semicolons, or your own separator.
Separators
New line, comma, semicolon, tab, space, pipe, any of those at once, or custom text. The input separator can be detected for you.
Clean up
Trim spaces, remove empty items, remove duplicates (with or without case), and sort A to Z, Z to A, by number, by length or in reverse.
Quotes
Wrap each item in single, double or backtick quotes, with a quote inside an item escaped by a backslash or doubled.
Ready made styles
SQL IN list, JSON array, CSV row, HTML list and bullet list fill in the options for you.
Quoted input
An item in quotes can contain the separator, so "Smith, Anna", "Lee, Bo" is read as two items.
Privacy
Your list stays in your browser. Nothing is uploaded or stored.

How to do it

  1. 1

    Paste your list

    Paste items from a spreadsheet column, a file or a message. The tool detects whether they are on separate lines or separated by commas, tabs, semicolons or spaces.

  2. 2

    Choose how to join them

    Pick the output separator, such as a comma and space, or a new line. Choose a custom one to use any text between items.

  3. 3

    Clean and style the items

    Remove duplicates, sort, add quotes, or press a ready made style such as SQL IN list or JSON array.

  4. 4

    Copy the result

    The converted list updates as you type. Copy it, or download it as a text file.

Converting between separators

A list is just items with something between them, and the something changes from place to place. A column copied from a spreadsheet has a line break between items. A list in an email has commas. Exported data may use tabs or semicolons. A search form or a database query often wants commas. This tool splits on whatever your list uses and joins on whatever you need.

With Detect automatically, a text with more than one line is split on line breaks. A single line is split on the most common of tab, semicolon, comma and pipe, and a line of words with only spaces is split on the spaces. If your list uses several kinds at once, choose Line break, comma, semicolon or tab. Space splits on any run of whitespace, line breaks included.

Quotes, escaping and ready made styles

Quotes make a list safe to paste into code. The ready made styles set up the details:

  • SQL IN list wraps each item in single quotes, doubles any quote inside it (O'Brien becomes 'O''Brien'), and puts brackets around the whole list: ('a', 'b', 'c').
  • JSON array uses double quotes, escapes a quote or backslash inside an item with a backslash, and adds square brackets: ["a", "b", "c"].
  • CSV row puts double quotes around each item, doubles any quote inside, and joins with commas, with no spaces.
  • HTML list wraps each item in <li> and the whole list in <ul>, and writes &, < and > inside an item as &amp;, &lt; and &gt; so that the page shows the text as typed. The switch for this is under More options. Bullet list puts - before each item.

The tool works on text and does not know what an item means, so numbers are quoted too. Set Put quotes around each item to None when you want a list of numbers. Control characters such as a tab inside an item are not escaped, so check the result before using it as strict JSON.

Cleaning a list

Trim spaces removes spaces at the start and end of each item, and Remove empty items drops blank ones, so a stray comma or an empty line does not leave a gap. Remove duplicates keeps the first copy of each item. Turn on Ignore case to treat Apple and apple as the same item. The result shows how many empty items and duplicates were removed.

A to Z and Z to A follow your browser's language rules, so accented letters sort with their base letter. Numbers in order treats a run of digits as a number, so item2 comes before item10. The other orders are shortest first, longest first and reverse.

Quoted items and commas at line ends

When Read quoted items is on, an item that starts with a quote and has a closing quote followed by a separator is one item, with the quotes removed. That is how "Smith, Anna", "Lee, Bo" becomes two items, not four. An apostrophe in the middle of a word, such as in it's, is never read as a quote.

Remove commas at line ends handles the reverse case. If every line of a list ends with a comma or a semicolon, as in a list written for a code array, those are taken off before the items are joined again.

Questions people ask

How do I turn a column from a spreadsheet into a comma separated list?

Copy the column and paste it in. Each cell is on its own line, so the list is split on line breaks. With Join items with set to Comma and space, the result is one line with commas between the items.

How do I convert a comma separated list to one item per line?

Paste the list, set Join items with to New line, and copy the result. The input separator is detected, or you can choose Comma yourself.

What if an item contains a comma?

Put the item in quotes, as in "Smith, Anna". With Read quoted items on, which is the default, it stays as one item. Without quotes, the comma splits it in two, so use a different separator such as a tab or a pipe for lists like that.

How do I remove duplicates from a list?

Turn on Remove duplicates. The first copy of each item is kept, in its original place. Turn on Ignore case to treat upper and lower case as the same.

Can it use a separator that is not on the list?

Yes. Choose Custom text for the input, the output or both, and type the text. Write \n for a new line and \t for a tab.

Is my list uploaded anywhere?

No. The conversion runs in your browser, and the list is never sent to a server.

Guides that help

All Text guides →