Skip to content
MoneyDeck

Text to List Converter

Split text into a clean list, or join a list into comma-separated text

Updated · Free, no signup

Result

apples
bananas
cherries
dates
apples
elderberries

Items in result

6

Empty items removed

1

Duplicates removed

0

  • 6 items in the result.
  • The list contains 1 duplicate — switch on "Remove duplicates" to drop it.

About the Text to List Converter

This text to list converter splits a block of text into separate items and rebuilds them in the format you need. Paste comma-separated values, words separated by spaces, tab-separated cells copied from a spreadsheet or text with any custom delimiter, and get a clean list with one item per line, bullets or numbering.

It works the other way too: paste a column of items, one per line, and join them into a comma-separated string, a quoted list, a JSON array, an SQL IN (…) clause or an HTML bullet list. That makes it handy for developers building queries and test data, marketers cleaning keyword and email lists, and anyone moving data between spreadsheets, documents and code.

Items are trimmed of surrounding spaces and empty entries are dropped by default. You can also remove duplicates and sort the result alphabetically. Duplicate detection is exact and case-sensitive after trimming, and sorting ignores capital letters so "apple" and "Apple" sit together.

How to use the text to list converter

  1. 1Paste your text, or a list with one item per line.
  2. 2Choose the delimiter that separates the items (comma, new line, tab, custom…).
  3. 3Pick the output format: one per line, bullets, numbers, comma-separated, JSON, SQL or HTML.
  4. 4Toggle trimming, empty-item removal, duplicate removal and sorting as needed.
  5. 5Copy the result.

Formula and method

The text is split wherever the chosen delimiter appears: a comma, semicolon, tab, pipe, line break, any run of whitespace, or a custom string matched literally. Each piece is then trimmed of surrounding spaces, empty pieces (for example from a double comma or trailing comma) are dropped, and duplicates can be removed keeping the first occurrence. Optional sorting compares items case-insensitively, using exact character order only to break ties.

The cleaned items are joined in the selected output format. Quoted output escapes inner double quotes with a backslash, SQL output doubles single quotes as SQL requires, JSON output is a standard JSON array, and HTML output escapes &, < and > inside each list item.

Worked examples

Comma-separated text to one item per line

Splitting on commas gives 7 pieces. Trimming removes the extra spaces and the blank piece between the two commas is dropped, leaving 6 items, one per line. "apples" appears twice because duplicate removal is off.

Deduplicated, sorted JSON array

With duplicates removed the second "apples" is dropped, the five remaining fruits are sorted A to Z and written as a JSON array.

Spreadsheet column to an SQL IN clause

Each line becomes one item, wrapped in single quotes and joined with commas inside parentheses. The apostrophe in O'Hare is doubled, which is how SQL escapes a quote inside a string.

Space-separated keywords to a numbered list

Splitting on any run of whitespace treats double and triple spaces as a single break, giving four keywords that are then numbered 1 to 4.

Frequently asked questions

How do I convert a comma-separated list into a column?+

Paste the text, choose "Comma" as the delimiter and "One item per line" as the output. Copy the result and paste it into a spreadsheet — each item lands in its own row.

How do I turn a column of items into a comma-separated list?+

Copy the column from your spreadsheet, paste it here, split by new line and choose "Comma-separated" or "Comma, no spaces" as the output format. Use the quoted, JSON or SQL formats if the list is going into code.

How do I split text by a custom character?+

Choose "Custom delimiter" and type the exact character or string that separates the items, such as " / ", "::" or " - ". The delimiter is matched literally, including any spaces you type.

Will it remove duplicate entries?+

Yes, switch on "Remove duplicates". The first occurrence of each item is kept in its original position. Matching is exact and case-sensitive after trimming, so "Apple" and "apple" are treated as different items.

How do I split cells copied from Excel or Google Sheets?+

Cells copied from one row are separated by tab characters, so choose "Tab". Cells copied from one column are separated by line breaks, so choose "New line".

Related tools