How to use the line joiner
- Paste your list into One item per line.
- Pick a separator in Join with: comma, comma and space, semicolon, tab, pipe, space, nothing, or Custom….
- If you chose Custom, type it in Custom separator. You can write
\nor\tfor a line break or a tab. - Choose Wrap each item: no quotes, ‘single’ or “double”.
- Leave Skip empty lines and Trim each item ticked unless the spaces and gaps matter. The joined line updates as you type; press Copy to take it.
What it does and when to use it
Lists often arrive one per line: a spreadsheet column, a list of IDs from a report, tags you typed in a notes app. Many places want them on one line instead, such as a search filter, a code array, a tag field or a database query. Joining by hand is slow and easy to get wrong, especially with quotes.
Typical jobs:
- Code and queries. Quote each ID for an SQL
INlist or a JavaScript array. - Tag and email fields. Join with “Comma and space” or “Semicolon ;” for forms that accept several values.
- Tab-separated rows. Join with Tab to paste a column across a spreadsheet row.
If the list needs cleaning first, run it through remove duplicates or the text sorter, then join it here.
How it works
The text is split at every line break (Windows, Mac and Unix line endings all work). With Trim each item on, spaces at the start and end of each item are removed. With Skip empty lines on, items that are empty after trimming are dropped. When you choose a quote style, any matching quote inside an item is doubled, and the item is wrapped in that quote. Finally the items are joined with your separator. Everything runs in your browser.
Worked examples
These results come from the tool’s own function.
Plain list. apple, banana, cherry on three lines, default settings, gives apple, banana, cherry.
SQL list with a messy paste. Lines 1001, 1002, an empty line and 1003 with spaces, joined with “Comma ,” and ‘single’ quotes, gives '1001','1002','1003'. Trimming removed the spaces and the empty line was skipped.
A name with an apostrophe. O'Brien and Smith with ‘single’ quotes and “Comma and space” gives 'O''Brien', 'Smith', so the query stays valid.
Limits and tips
- The quote doubling suits SQL and CSV. Languages that escape with a backslash, such as JavaScript, may need double quotes instead, or a small edit.
- There is no option to wrap the whole result in brackets; type
(and)around it yourself. - To add text before or after each line rather than join them, use add prefix and suffix. To merge wrapped lines of prose into paragraphs, remove line breaks is the better fit.
Frequently asked questions
How do I turn a column from a spreadsheet into a comma-separated list?
Can I make a list for an SQL IN clause?
What happens to a quote mark that is already inside an item?
Why did my blank lines disappear?
How do I split the joined line back into lines?
How do we know nothing is uploaded? Test it yourself on the privacy proof page.