TextToolboxTextToolbox

Merge Lines Tool

Join physical lines with an exact separator. Keep blank items and spaces, choose explicit cleanup and inspect the full result before copying.

Built by Saurabh Kumar

Quick Answer

Merge physical-line items with a selected separator. Empty items and edge spaces stay unless Trim items or Drop whitespace-only items is enabled. Original line endings are replaced.

Separator text is literal unless Decode backslash escapes is enabled. Sample restores comma + space and clears all three switches; Clear keeps your settings. Joining does not quote or escape items.

0 retained items. Empty result remains selectable; Copy is disabled when there is no output text.

Joining Lines With an Exact Separator

Turn a one-item-per-line list into text joined by an exact separator. Keep blank items and edge spaces, or remove them with explicit cleanup switches. The separator can include line breaks, so joining does not always produce one physical line.

Entering the List and Choosing a Separator

  1. Paste your list in Input text. Keep the original if its spacing or newline types matter.
  2. Set Separator or choose Comma, Comma + Space, Space, Pipe or No separator.
  3. Enable Decode backslash escapes only when you intentionally typed backslash n, r, t or a doubled backslash. Unknown and unfinished escapes are errors.
  4. Inspect the result with Trim items and Drop whitespace-only items off first. Enable each only when that information should change.
  5. Check the retained-item count and complete output, then Copy. If Copy fails, select Output text manually.

Sample loads the stored list, restores comma + space and clears the three switches. Clear empties the source while keeping your settings.

How Items Are Joined and Cleaned

Physical CRLF, LF and lone CR separate items. A trailing line ending creates a final empty item; empty input has no items. Joining replaces the original endings with your Separator. An empty separator concatenates the item text.

Trim items removes each item’s edge whitespace. Drop whitespace-only items removes items whose trimmed value is empty, but does not trim the surviving items unless Trim is also enabled. Escape decoding is a single pass: doubled backslash followed by n remains literal backslash plus n.

Six Joins With Exact Output

Quoted strings below use JSON escape notation to make line breaks, tabs and edge spaces explicit. This is a display convention, not a JSON export feature. Cleanup is off unless the row says otherwise.

Complete join results with exact settings
InputSeparator and cleanupComplete outputItems
"A\n\nB"Comma + Space, default"A, , B"3
" A \n\t\nB"Pipe; Drop only" A |B"2
" A \n\t\nB"Pipe; Trim and Drop"A|B"2
"A\r\nB\rC\n"Literal double pipe"A||B||C||"4
"A\nB"No separator"AB"2
"A\nB"Backslash n; Decode enabled"A\nB"2

When a Later Split Can Recover the List

Join plain labels for a text draft, combine lines with a delimiter used by a simple importer, or compare the effect of removing blanks. If a later split is planned, choose joining text absent from the item contents and leave cleanup off.

What a later split can recover
Source and joinLater split resultDecision
"A\nB", pipe"A\nB"Suitable LF list, no embedded pipe
"A\r\nB", pipe"A\nB"CRLF identity is lost
"A|x\nB", pipe"A\nx\nB"Embedded delimiter creates another item

Collisions, CSV and Limits

Joining with commas does not quote fields that already contain commas, quotes or line breaks. Use a format-aware serializer for CSV, JSON or SQL rather than treating a plain joined string as structured data. RFC 4180 explains CSV field quoting; Extract Column provides supported CSV parsing.

Malformed Unicode, unsupported escape sequences or exceeded budgets show an editable error and clear output; Copy stays disabled until correction. The source cap is 1,000,000 UTF-16 units and 20,000 physical lines, the separator cap is 1,000 units, and the result cap is 5,000,000 units. No source is silently shortened.

Try a few items containing a blank, edge spaces and the intended separator before processing a larger list. Inspect what the destination expects; local item counts do not certify its import rules. Split Text handles the opposite literal-delimiter task, but it cannot recover information removed by cleanup or original newline replacement.

Separator changes, cleanup switches, Sample, Clear and source edits invalidate Copy feedback, including pending requests. Clipboard success does not certify a saved file or receiving app. Keep the ordinary original for recovery.