A one-per-line list sits in your notes, a spreadsheet, or a text file. The field you need to paste into demands a single line of comma-separated items. Here is how to join lines with a comma in Microsoft Word, Excel, Google Sheets, and a browser-based notepad. You will also learn the reverse: splitting a comma-separated string back into a list, and cleaning the data before or after.
Using SimpleText for a Quick Browser-Based Conversion
SimpleText is a private text notepad that saves as you type and never uploads anything. Its Join lines tool collapses text into one paragraph.
Joining lines and adding commas
Paste your one-per-line list into SimpleText, then click Join lines. The lines merge with spaces. To get commas instead, use Find and Replace afterward to swap spaces for commas, or add them manually. SimpleText also has Trim to tidy stray spaces and blank lines, plus Sort and Dedupe to remove duplicates before joining. This avoids messy output. Copy the result or download it as a .txt file.
Joining a List in Microsoft Word
Step-by-step procedure
- Open your document in Word and ensure each list item is on its own line.
- Press Ctrl+H (or Cmd+H on Mac) to open Find and Replace.
- In the Find field, type ^p (the code for a paragraph mark).
- In the Replace field, type , (comma followed by a space).
- Click Replace All. Word swaps each line break for a comma and space, producing a single comma-separated string.
If your list includes blank lines, run Trim or remove them manually beforehand. That prevents double commas. To reverse the operation, paste a comma-separated string into Word and swap , for ^p. The string splits back into a list.
Using Excel for a Range of Cells
Excel's TEXTJOIN function (available in Excel 2019 and Microsoft 365) joins a range with a delimiter.
Using TEXTJOIN
If your list is in cells A1 through A10, enter this formula in another cell:
=TEXTJOIN(", ",TRUE,A1:A10)
The first argument is the delimiter (comma and space). The second argument, TRUE, tells Excel to skip empty cells. The third argument is the range. For a simple comma without a space, use "," as the delimiter.
Splitting a comma-separated string into cells
To convert a comma-separated string back into a list, use Data > Text to Columns. Select the cell containing the string, go to Data > Text to Columns, choose Delimited, select Comma as the delimiter, and click Finish. Each item lands in a separate column. Copy the column and paste it as a list.
Google Sheets TEXTJOIN and SPLIT
Google Sheets has a TEXTJOIN function with the same arguments as Excel. To join a column into a comma-separated list, use:
=TEXTJOIN(", ",TRUE,A1:A10)
TRUE skips empty cells. To split a comma-separated string back into a list, use SPLIT. If cell B1 contains your comma-separated string, enter =SPLIT(B1, ",") in another cell. SPLIT divides the string by commas and places each item into adjacent cells. Copy those cells and transpose them into a column if needed.
Cleaning Your Data Before and After Joining
Messy input leads to messy output. Before joining lines with a comma, trim extra spaces and remove blank lines and duplicates. In SimpleText, use Trim to strip leading and trailing spaces and blank lines, then Sort and Dedupe to eliminate duplicates. In Excel or Google Sheets, use TRIM() and UNIQUE(), or sort and delete duplicates manually. After joining, a second Trim pass clears any stray spaces around commas.
CSV (comma-separated values) files use commas between fields and line breaks between rows. If your list is a single column of a CSV, joining it with commas creates a single field, not a full CSV row. For CSV, each field stays separate by commas, and rows by line breaks.
Common Scenarios and Practical Tips
- Emails: The To, CC, and BCC fields accept comma-separated addresses. Use any method above to convert a list of email addresses into a comma-separated string.
- Spreadsheets: Data copied from a web page or text file often arrives as a one-per-line list. TEXTJOIN or Find and Replace formats it for a single cell.
- Code and form fields: Some web forms and code inputs expect comma-separated values. Join your list before pasting.
- Reverse operation: Received a comma-separated string and need a list? Use SPLIT in Google Sheets, Text to Columns in Excel, or swap commas for line breaks in Word.
Choosing the Right Tool for the Task
For a quick, private conversion without installing software, SimpleText delivers Join lines, Trim, Sort and Dedupe, and live word, character and line counts. Text stays in the browser's local storage. Nothing gets uploaded. For larger spreadsheets, Excel and Google Sheets provide TEXTJOIN and SPLIT. Word's Find and Replace handles one-off text documents. Pick the tool where your data already lives.