Convert a Column to a Comma Separated List Free
Turn an Excel column or one-per-line list into "a, b, c" for SQL IN, email or tags, free: paste, choose Join with, set a separator, copy.
Published · 5 min read
To convert a column to a comma separated list, copy the column from Excel or Google Sheets, paste it into the free line break remover, choose Join with…, and keep the separator as a comma and a space. Every line becomes one item, like Mumbai, Delhi, Pune, and empty rows are dropped. Change the separator to ; for email addresses or ', ' for a SQL IN list. It's free and your data stays on your device.
This is a different job from fixing text copied out of a PDF. If that's your problem, see how to remove line breaks from copied text.
How to convert a column to a comma separated list
- In your spreadsheet, click the first cell of the column and select down to the last one. Copy (Ctrl+C, or Cmd+C on a Mac).
- Open the free line break remover and paste into Your text.
- Choose Join with…. A Separator box appears, already holding a comma and a space.
- Change the separator if you need to (examples below).
- Leave Remove extra spaces ticked. It trims stray spaces at the start and end of each cell, so
DelhibecomesDelhi. - Click Copy and paste the result wherever you need it.
The result updates as you type, so you can try different separators and watch the output change.
Separators for common jobs
| You need | Type this separator | Result |
|---|---|---|
| Plain list for a document | , |
Mumbai, Delhi, Pune |
| CSV-style, no spaces | , |
101,102,103 |
| Email addresses for Outlook | ; |
asha@example.com; ravi@example.com |
| Tags or keywords | , |
budget travel, solo trip, hostels |
| Pipe-separated values | | |
red | green | blue |
Numbers for a SQL IN |
, |
101, 102, 103 |
Text values for a SQL IN |
', ' |
Mumbai', 'Delhi', 'Pune (add the outer quotes yourself) |
Most email apps, including Gmail, also accept commas between addresses; Outlook traditionally uses semicolons. If one doesn't work, try the other.
Building a SQL IN list
For numeric IDs, a comma separator is all you need:
SELECT * FROM orders WHERE customer_id IN (101, 102, 103);
Text values need quotes around each one. The tool doesn't add quotes, but there's a neat trick: use ', ' (quote, comma, space, quote) as the separator. That puts the quotes between items, so you only have to type one quote at the very start and one at the very end:
- Separator:
', ' - Output:
Mumbai', 'Delhi', 'Pune - Add
'at both ends:'Mumbai', 'Delhi', 'Pune' - Paste inside
IN ( ... ).
Watch for values that already contain an apostrophe, like O'Brien. In SQL that must be written O''Brien, or the query breaks. For a long list with names, search the output for a lone ' before running it.
Very long IN lists (thousands of values) can be slow or hit a database limit. At that size, loading the values into a temporary table is usually better.
Clean the list first: duplicates and order
Spreadsheet columns often have repeats, blanks and messy capitals. The free alphabetizer can tidy the list before you join it:
- Tick Remove duplicates (with Ignore capitals on,
Puneandpunecount as one). - Pick A to Z, or Keep order if the original order matters.
- Open Separators and numbering and set Join the result with to Commas.
That gives you a deduplicated, comma-separated line in one go, always with a comma and a space between items. Use the line break remover when you need a different separator, like ; or ', '. Our guide to removing duplicates from a list covers the dedupe options in detail.
Going the other way: comma list to a column
Got a, b, c and need one item per line to paste into a spreadsheet? In the free alphabetizer, open Separators and numbering, set Items are separated by to Commas and Join the result with to New lines, and choose Keep order in the Sort menu. Copy the result and paste it into the first cell of a column.
Things that trip people up
- Copy one column only. If you copy two columns, the cells on each row are separated by a tab. With Remove extra spaces on, that tab becomes a space, so
Asha(tab)Mehtaturns intoAsha Mehtaas one item. That's handy for first and last names, but not if you wanted two items. - Commas inside values. A value like
Mumbai, Maharashtrawill look like two items in a comma-separated list. Use a different separator, such as;or|. - Header row. If you copied the column header, delete it from the result (or don't select it).
- Leading zeros. Spreadsheet IDs such as
00742may already have lost their zeros in the sheet. Check the column is formatted as text before copying.
Doing it inside the spreadsheet
If you'd rather stay in the sheet, Excel 2019 and later, Microsoft 365 and Google Sheets have a formula: =TEXTJOIN(", ", TRUE, A2:A100). The TRUE skips empty cells. It's useful when the list changes often; the browser tool is quicker for a one-off, and works the same with lists from emails, chats or documents.
Join your list now
Paste your column into the free line break remover, choose Join with…, set your separator and copy the line. It's free, there's no sign-up, and nothing you paste leaves your device.
Frequently asked questions
- How do I convert a column into a comma separated list?
- Copy the column, paste it into a line break remover, choose Join with and use a comma and a space as the separator. Copy the single line it produces.
- How do I add quotes around each item for SQL?
- Use
', 'as the separator so quotes appear between items, then type one quote at the start and one at the end of the line. - Will blank rows create empty items like ", ,"?
- No. Empty lines are skipped when joining, so blank cells don't leave gaps in the result.
- What separator does Outlook use for email addresses?
- Outlook traditionally uses semicolons between addresses, so use
;as the separator. Many other email apps accept commas too. - Can I remove duplicates at the same time?
- Yes, with the free alphabetizer: tick Remove duplicates and set Join the result with to Commas. It uses a comma and a space between items.
Text tools
Try Remove Line Breaks
Free, no sign-up, works in your browser. Paste text copied from a PDF, email or website and remove the unwanted line breaks in one step.
Also useful
- Sort List AlphabeticallyPut any list in alphabetical order, from A to Z or Z to A, sort by number or length, reverse or shuffle it, and remove duplicates and blank lines. Paste one item per line or separated by commas, then copy or download the sorted list.
- Word CounterPaste or type your text to count words, characters (with and without spaces), sentences and paragraphs as you type, plus reading time, speaking time and your most used words. Nothing to click: the numbers update live. What you type stays on your device.