Reverse a list of paragraphs

Reverse the order of paragraphs where blank lines separate each paragraph. Split regex is `/\n\s*\n/` - any run of blank / whitespace-only lines marks a paragraph boundary. Output uses double-newline joining, preserving structure. Single-line-separated input will be treated as one paragraph.

Input
Ready
Output
Live

Blank-line-aware paragraph reversal

The op is `input.split(/\n\s*\n/).reverse().join('\n\n')`. Input is split on blank-line runs; each resulting block is one paragraph. The array is reversed and rejoined with double newlines so paragraph structure survives the round trip.

Paragraph internals (line wrapping, internal whitespace) are untouched - only the block order flips. A 3-line paragraph stays a 3-line paragraph; only its position in the list changes.

Self-inverse: running the tool twice restores the original input. Single-paragraph input (no blank-line separators) is emitted unchanged - the split produces one array element and reversing one element is a no-op.

How to use reverse a list of paragraphs

  1. 1Paste paragraphs separated by blank lines into the input panel
  2. 2Output flips the block order - last paragraph first
  3. 3No options; the operation is deterministic
  4. 4Running the tool twice returns the original input
  5. 5For line-order reversal (no blank-line awareness), use Reverse a list

Keyboard shortcuts

Drive ListShift without touching the mouse.

Shortcut Action
Ctrl ZUndo last input change
Ctrl Shift ZRedo
Ctrl Shift EnterToggle fullscreen focus on the editor
EscExit fullscreen
Ctrl KOpen the command palette to jump to any tool
Ctrl SSave current pipeline draft Plus
Ctrl PRun a saved pipeline Plus

What this tool actually does

One-pass blank-line-split reversal, no options.

Blank-line boundaries

Regex `/\n\s*\n/` detects one or more blank / whitespace-only lines between paragraphs. Single-line-wrapped paragraphs are one unit.

Double-newline join preserves structure

Output uses `\n\n` between paragraphs. Your blank-line spacing is preserved exactly one blank line wide, even if the source had extra blanks.

Paragraph internals untouched

Multi-line paragraphs keep their internal line breaks and whitespace. Only the paragraph-block order flips.

Self-inverse

Applying the tool twice gives you back the original input. No separate undo tool.

Single-paragraph input is a no-op

If your input has no blank lines, the split produces one paragraph and reversing it is the identity. Output equals input.

Worked example

Three paragraphs separated by blank lines - order flipped.

Input
Paragraph one.

Paragraph two.

Paragraph three.
Output
Paragraph three.

Paragraph two.

Paragraph one.

Behavior reference

No user options. These are the fixed rules.

Rule What it does Example
Block-order reversal Last paragraph → first, first → last `One / / Two / / Three` → `Three / / Two / / One`
Blank-line split via `/\n\s*\n/` Runs of blank / whitespace lines collapse to one separator Three blanks between paragraphs behave the same as one
Double-newline join Output paragraphs always separated by exactly one blank line Spacing is normalized on emit
Self-inverse Reversing twice = original No separate un-reverse tool
No blank lines in input (automatic) Treated as one paragraph - output identical to input Add a blank line between paragraphs first

FAQ

How does this differ from Reverse a list?
Reverse a list reverses individual lines (line-order reversal). This tool splits on blank lines first, treating each block as one paragraph, then reverses those blocks. Pick by whether each line is an item (use Reverse a list) or each blank-line-separated block is an item (use this).
What is the exact regex for paragraph boundaries?
`/\n\s*\n/` - a newline, optional whitespace (which can include more newlines), another newline. Any run of blank-or-whitespace-only lines counts as one separator.
Does it preserve wrapping inside a paragraph?
Yes. Only the paragraph-block order changes. Internal line breaks, leading spaces, and whitespace inside each block are emitted exactly as they were.
What if my input has only one paragraph?
The output is identical to the input. The split produces one element and reversing one element is a no-op.
What is the opposite operation?
Applying this tool again. Reverse is self-inverse.