OnlineNotes Logo

    Comma Separator

    Paste a column from a spreadsheet or a list with one item per line. Get one line of comma separated values, ready for SQL, code or a form field. Or switch direction to split a list back into lines.

    Options

    About this tool

    Data often sits in a column: a spreadsheet of order numbers, emails copied from a CRM, tags from a CMS. Code and query tools want the same values on one line, separated by commas, often in quotes. A SQL query like WHERE id IN (1042, 1043, 1057) is the classic case, and so is a list of email addresses for the To field.

    The tool also works the other way. A comma separated line copied from code or an email becomes one item per line, ready to paste into a spreadsheet column. Quotes around items are removed when splitting, so "red", "green" becomes red and green on their own lines.

    How it works

    1. Paste your values. For joining, put one item per line. For splitting, paste one line.
    2. Pick the direction, the separator and whether each item gets quotes.
    3. Empty lines are skipped and spaces at item ends are trimmed.
    4. Copy the result. The count shows how many items there are.

    Worked example

    Input

    red
    green
    blue

    Output

    'red', 'green', 'blue'

    With comma and space as the separator and single quotes, the column becomes a list you can paste into a SQL IN (...) clause.

    Edge cases and limits

    • Quotes inside an item are not escaped. For values that contain quotes or commas, use a CSV tool instead.
    • Splitting uses the chosen separator only. A list that mixes commas and semicolons needs two passes.
    • Very long lists work, but some form fields have their own character limit.

    Frequently asked questions

    How do I convert a column to a comma separated list?

    Copy the column from Excel or Google Sheets, paste it here and keep the direction on "Lines to one line". Copy the result.

    How do I convert a comma separated list to rows?

    Switch the direction to "One line to lines", pick comma as the separator, and paste the list. Each item goes on its own line.

    Can Excel do this without a tool?

    Yes, with =TEXTJOIN(", ", TRUE, A1:A100) in Excel 2019 or later. Adding quotes needs a longer formula, which is where this tool saves time.

    Related tools