Paragraph Sorter

Splits text into paragraphs and sorts them alphabetically using locale-aware comparison, in ascending (A-Z) or descending (Z-A) order, rejoining them with a blank line between each. A free online tool from Staaarter, right in your browser.

Runs locallyUpdated 2026-07-23

Overview

Introduction

Reordering the paragraphs of a pasted document alphabetically can help with review, grouping related sections, or producing a deterministic ordering.

This tool does it automatically instead of manually cutting and reordering paragraphs by hand.

What Is Paragraph Sorter?

A paragraph sorter that splits text into paragraphs on blank lines and alphabetizes them using locale-aware string comparison, with an option to reverse the order.

It runs entirely client-side as part of this site's String Tools collection, so nothing you paste is ever uploaded to a server.

How Paragraph Sorter Works

The input is split into paragraphs on blank lines, sorted with localeCompare() for human-friendly ordering, optionally reversed for descending order, and rejoined with a blank line between each.

The transformation happens synchronously in JavaScript the moment you type, with no network round trip involved.

When To Use Paragraph Sorter

Use it to alphabetize the paragraphs of a pasted document for review, or to group related sections together by their leading text.

It's a fast way to get the answer without opening a code editor, a REPL, or writing a one-off script just to check.

Often used alongside Text Sorter and Sentence Sorter.

Features

Advantages

  • Locale-aware comparison generally matches human expectations better than raw character-code sorting.
  • Preserves the internal text of each paragraph exactly, only reordering whole blocks.

Limitations

  • Paragraph detection relies on blank lines between blocks, so text without blank-line separation is treated as a single paragraph.

Examples

Sorting two paragraphs

Input

Zebra paragraph text here.

Apple paragraph text here.

Output

Apple paragraph text here.

Zebra paragraph text here.

The two paragraphs are reordered alphabetically by their leading text.

Best Practices & Notes

Best Practices

  • Use Sentence Sorter instead if you want to reorder individual sentences rather than whole paragraphs.

Developer Notes

Paragraphs are split with `/\n\s*\n/`, sorted using `(a, b) => a.localeCompare(b)`, and optionally reversed for descending order, then joined with `\n\n`.

Paragraph Sorter Use Cases

  • Alphabetizing paragraphs in a pasted document for review
  • Grouping related sections together by their leading text
  • Producing a deterministic paragraph order for a report

Common Mistakes

  • Pasting text without blank lines between paragraphs; the sorter then treats the whole input as one paragraph.

Tips

  • Run Paragraph Filter first if you only want to sort a subset of paragraphs matching a keyword.

References

Frequently Asked Questions