How to replace newlines with commas
- Paste your list into Input, one item per line. A column copied from Excel or Google Sheets works as it is.
- The result is already joined with commas. Turn off Trim lines if spaces around items matter.
- Copy the comma-separated line and paste it where you need it.
From a column to a comma-separated line
Spreadsheets, databases and many forms want a list as one line, like London, Paris, Berlin. When you copy a column from Excel or Google Sheets, though, every cell arrives on its own line. This page replaces each of those line breaks with a comma, trims stray spaces from the start and end of each item, and drops blank rows, so the result is ready to paste.
Where a comma-separated list is useful
- Email “To” and “CC” fields, which accept addresses separated by commas.
- SQL queries such as
WHERE city IN (…), after quoting each value. - Tag fields in CMSs and online stores that expect
tag1, tag2, tag3. - Pasting a list into a single spreadsheet cell or a CSV field.