Lines to One Line

Convert multi-line text into a single line with a custom separator.

Free Online Multi-line to One Line Converter

Paste text with line breaks and collapse it into one continuous line. Choose a separator - space, comma, pipe, semicolon, none, or a custom string - and optionally trim lines or drop empty ones.

Handy for turning bullet lists into comma-separated values, fixing copy-paste from emails, building shell one-liners, and cleaning text for JSON strings or chat prompts. Everything runs locally in your browser.

Why Convert Multi-line Text to One Line?

Multi-line text shows up everywhere: copied lists from spreadsheets, bullet points from docs, log snippets, and command output. Many tools and formats expect a single line - CSV fields, JSON string values, shell one-liners, Slack messages, and SQL IN clauses.

Joining lines by hand is slow and error-prone. A dedicated converter lets you paste once, pick a separator, and copy a clean one-liner without hunting for stray newlines or trailing spaces.

Choosing the Right Separator

Use a space when you want readable prose or a simple sentence from line-broken paragraphs.

Use a comma or comma-space for CSV-style lists, tags, and keyword strings. Pipe (|) or semicolon separators work well for shell paths, alternate values, and configs that already use commas.

Choose "none" to concatenate lines with no delimiter - useful for joining split tokens or fixing text that was wrapped mid-word. Custom separators cover anything else: tabs, newlines escaped as \n, HTML <br>, or " AND " for search queries.

Trim, Empty Lines, and Whitespace

Trimming each line removes leading and trailing spaces that often appear when copying from editors or PDFs. Removing empty lines prevents double separators when blank rows sneak into a paste.

"Collapse whitespace" is optional: after joining, it replaces runs of spaces/tabs/newlines with a single space and trims the ends. Turn it on when your source has ragged spacing; leave it off when the separator itself contains intentional spaces (like ", ").

Common Use Cases

Turn a vertical list of emails or usernames into a comma-separated string for forms and scripts.

Convert a multi-line SQL SELECT list or a column of IDs into a single IN (...) argument with commas.

Build one-line curl or docker commands from notes that were written with line breaks for readability.

Flatten chat prompts, README snippets, or scraped text before pasting into APIs that reject control characters.

Frequently Asked Questions

How do I convert multi-line text to a single line?
Paste your text into the input box. Pick a separator (space, comma, pipe, or custom), optionally trim lines and remove empty ones, then copy the one-line output. Processing updates live as you type.
What separator should I use?
Use a space for sentences and prose. Use comma or comma-space for lists and CSV-like values. Use pipe or semicolon when commas already appear in the data. Use none to concatenate with no delimiter, or custom for tabs, HTML breaks, or any string you need.
Does this tool remove empty lines?
Yes, if "Remove empty lines" is enabled (on by default). Blank lines are dropped before joining so you do not get double separators. Turn the option off if you want empty entries preserved as consecutive separators.
Can I join lines with a custom delimiter?
Yes. Choose the Custom separator option and type any string - for example a tab, " -> ", "\n" as literal characters, or " AND ". The exact characters you enter are used between each line.
Is my text uploaded to a server?
No. Conversion runs entirely in your browser. Your input never leaves your device, so it is safe for private lists, logs, and credentials you would not paste into a remote tool.
How is this different from Line Sort / Dedupe?
Line Sort / Dedupe keeps one item per line and focuses on sorting, uniqueness, and cleaning. Lines to One Line collapses many lines into a single string with a separator. Use both when you need to clean a list first, then join it.
Can I replace newlines with commas for CSV?
Yes. Select the comma or comma-space separator, enable trim and remove-empty if needed, then copy the result. For true CSV with quoted fields, review values that already contain commas before pasting into a spreadsheet.