Replace New Lines with Commas turns a list with one item per line into a single comma separated line. Paste your text, click the button and copy the result. It is free and runs in your browser.
apple banana cherry
apple,banana,cherry
Bookmark: press Ctrl+D (Windows) or Cmd+D (Mac) to save this tool.
This tool replaces every new line in your text with a comma. A list with one item on each line becomes one line of comma separated items, ready to paste into a spreadsheet, a database query, a form or a program.
Empty lines are skipped by default, so you do not get a row of commas in a row, and spaces around each line are trimmed. You can add a space after each comma if you want a list that is easy to read, such as apple, banana, cherry.
Use it for email lists, tags, keywords, product codes, ID numbers and anything else you copied as a column.
Unless an option is named, no space is added after the comma, empty lines are skipped and spaces around each line are trimmed.
| Setting | Before | After |
|---|---|---|
| Simple list | apple banana cherry | apple,banana,cherry |
| Numbers | 1 2 3 4 | 1,2,3,4 |
| Space after each comma | apple banana cherry | apple, banana, cherry |
| Empty lines skipped | red green blue | red,green,blue |
| Empty lines kept | red green blue | red,,green,,blue |
| Spaces trimmed | one two | one,two |
| Spaces not trimmed | one two | one , two |
Turning a column from a spreadsheet into a comma separated list, preparing values for a database query or a form, and joining tags, keywords, email addresses and ID numbers.
An item that already contains a comma is not wrapped in quotes, so it will look like two items. Quotes around each item are not added either. The result replaces your text, so use Undo if you need the original.
To turn commas back into lines, try Convert Text with Commas To Lines. To remove line breaks without adding anything, try Remove Line Breaks. To drop empty lines first, try Remove Empty Lines.
It converts text that has new lines into one line where the items are separated by commas.
Paste your list, with one item on each line, then click Replace New Lines. Copy the result with the Copy button.
No. Commas are placed only between items, so the result does not end with a comma.
Yes. Tick Add a space after each comma and the result looks like apple, banana, cherry instead of apple,banana,cherry.
By default they are skipped, so you do not get two commas in a row. Untick Skip empty lines to keep them, and each one then leaves an empty item between two commas.
Yes, by default, so an item written as " apple " becomes apple. Untick Trim spaces around each line to keep them.
Yes. Lines are split correctly whichever kind of line break your text has.
The tool shows a message and leaves your text as it is.
Yes. It is free, needs no account and runs in your browser, so your text is not uploaded to a server.
Last updated: 14 November 2026