Replace Comma with New Line
Paste a comma-separated string and convert it into a list with one item per line. Useful for turning CSV rows back into spreadsheet columns, breaking inline tag lists into editable lists, or normalizing input from any comma-delimited source.
How to convert commas to new lines
1. Paste your comma-separated text
Drop the comma-delimited string into the input box. Whether it has spaces after each comma or not, both work. Multi-line input is accepted; lines are treated as additional content to split.
2. Pick the separator
The default is comma. If your input is delimited by something else (semicolon, pipe, tab, or any custom character), switch the radio in the sidebar. The Custom option lets you type any separator string.
3. Tune trim and dedupe
Trim each item removes leading and trailing whitespace per result. Drop empty items removes blank entries that result from consecutive separators. Drop duplicates removes repeated entries from the output.
4. Copy or download
The output box updates live as you change settings. Use Copy for clipboard, Download .txt for a file. Reverse mode (newlines back to a separator) is in the sidebar if you need the inverse operation.
When you need this conversion
Splitting comma-separated input into one item per line comes up in everyday work.
Pasting CSV into a spreadsheet column
A comma-separated string copied from an email or chat needs to become a spreadsheet column. Convert to newlines, copy, paste into Excel or Google Sheets: each value lands in its own row.
Editing tag lists
Tag fields in CMSes often store tags as tag1, tag2, tag3. To edit one tag at a time, convert to newlines, edit, convert back to comma-separated with the reverse mode.
Cleaning up bulk-import data
A list of names, emails, or IDs pasted as a single comma-separated string becomes ingestion-ready after conversion to newlines. Add dedup and empty-drop for a cleaner result.
Converting between API payload formats
Some APIs accept comma-separated arrays in URL params; others expect one item per line in a POST body. The converter swaps between formats in one click.
Quick sanity check on counts
The widget shows item count, unique count, and empty count. Useful for verifying that a CSV does not have duplicate rows or stray empty cells before importing.
Reverse mode: newlines back to commas
Flip the direction radio in the sidebar to Newlines -> separator and the converter joins your line list with whatever character is in the join field. Default join is , (comma + space) which is the common comma-list format. Change it to just , for compact lists or ; for European-style separators.
Reverse mode honors all the same options: trim each item, drop empty, drop duplicates. So a noisy line list with blank lines and duplicates becomes a clean comma-separated string in one pass.
Separator options: comma, semicolon, pipe, tab, custom
| Separator | When to use | Example |
|---|---|---|
Comma , | CSV files, English-style lists | a, b, c |
Semicolon ; | European CSV (where comma is the decimal point), tag lists | a; b; c |
Pipe | | Unix command output, data export from some DBs | a|b|c |
| Tab | TSV files, Excel column copies | a b c |
| Custom | Anything else (slash, double dash, regex) | a/b/c |
Edge cases: empty values, escaped commas, quoted CSV
Empty values
An input like a,,b produces three items: a, empty, b. Turn on Drop empty items to remove the blank slot from the output. Turn it off if you need to preserve the position of empty cells (rare but important in some spreadsheet imports).
Escaped commas inside values
The converter does a plain split on the separator character. It does not understand CSV-style quoted strings. A line like "Smith, John",555 splits into 3 items, not 2. For quoted CSV, use a real CSV parser (paste into a spreadsheet, then export to a different format).
Multiple consecutive separators
Treated as empty items between separators. a,,,,b produces 5 items: a, 3 empties, b. The Drop empty items toggle collapses those.
Separators inside the values themselves
If your data has commas inside the meaningful values (a price like "1,250" or a date like "May 27, 2026"), you cannot use comma as the separator. Switch to a different separator first via find-and-replace, then convert.
Combining with other tools
The comma-to-newline conversion is often a step in a longer cleanup pipeline.
Combine with deduplication
Convert your comma list to lines, then run remove duplicates if the built-in dedup is not aggressive enough for your case (e.g. case-insensitive dedup, fuzzy match).
Combine with sorting
Convert to newlines, then sort alphabetically to produce an A-Z list. Reverse back to comma-separated for inline use.
Combine with line-counter
After converting, the line counter tells you how many items the CSV contained. Useful for verifying import row counts.
Combine with word-replacer
If you need to transform every item (add a prefix, change case), convert to newlines, run word replacer with the right regex, then reverse back to comma-separated.
Related tools
Frequently asked questions
What if my input uses semicolons or pipes instead of commas?
Switch the separator radio in the sidebar to Semicolon, Pipe, Tab, or Custom. The converter splits on whatever character you select. For something less common (slash, colon, double-dash), use Custom and type the separator string.
How do I go from newlines back to commas?
Switch the direction radio to Newlines -> separator. The converter joins the lines with whatever string is in the Join field (default is comma + space). Change the join string for compact lists, alternative separators, or formatting.
Does it handle quoted CSV strings?
No. The converter does a plain split on the separator. A quoted CSV cell like "Smith, John" gets split at the comma inside the quotes. For quoted CSV, use a real CSV parser (Excel, Google Sheets, or a script with a CSV library).
What happens to empty items?
By default, empty items (from consecutive separators like a,,b) are dropped. The Empty dropped stat counts them. Turn off Drop empty items in the sidebar to preserve them if positional alignment matters.
Does the text leave my browser?
No. The converter runs entirely in your browser using JavaScript. Your input and the converted output are never sent to our servers and are not logged.
Can I use a multi-character separator?
Yes. Use the Custom separator and type the multi-character string. Common examples: / or - or ||. The converter splits on the exact string match.
Is there a limit on input size?
No hard cap. The converter handles multi-megabyte inputs comfortably. Split and join operations are O(n).
Why does my comma list have an extra empty line at the end?
The trailing newline in your input creates an empty item after the last separator. With Drop empty items on, it is removed. With it off, you see an extra blank line in the output. Toggle Drop empty items to control this.
More wordcounter.ai tools
Other tools you might find useful.