Sentence Sorter

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

Runs locallyUpdated 2026-07-23

Overview

Introduction

Reordering the sentences of a pasted passage alphabetically can help spot patterns, group similar statements, or just produce a deterministic ordering for review.

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

What Is Sentence Sorter?

A sentence sorter that splits text into sentences 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 Sentence Sorter Works

The input is split into sentences on punctuation boundaries, sorted with localeCompare() for human-friendly ordering, optionally reversed for descending order, and rejoined with single spaces.

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

When To Use Sentence Sorter

Use it to alphabetize the sentences of a pasted passage for review, comparison, or grouping similar statements together.

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 Paragraph Sorter.

Features

Advantages

  • Locale-aware comparison generally matches human expectations better than raw character-code sorting.
  • One-click toggle between ascending and descending order.
  • Compares the sentence's full text, so sentences opening with the same word are ordered by what follows rather than left in arbitrary order.

Limitations

  • Sentence detection is a simple punctuation-based heuristic, so it can mis-split on abbreviations like 'Dr.' or decimal numbers.
  • Rejoins with single spaces, so original paragraph breaks are lost.

Examples

Sorting three sentences

Input

Cats are great. Apples are red. Bikes need air.

Output

Apples are red. Bikes need air. Cats are great.

Sentences are reordered alphabetically by their first letter.

Best Practices & Notes

Best Practices

  • Use Paragraph Sorter instead if you want to reorder whole paragraphs rather than individual sentences.
  • Sort short, self-contained lines such as list items, since ordinary prose loses its argument entirely once alphabetized.
  • Strip leading quotation marks or numbering first, because they take part in the comparison and pull those sentences out of position.

Developer Notes

Sentences are split with `/[^.!?]*[.!?]+(?=\s|$)|[^.!?]+$/g`, sorted using `(a, b) => a.localeCompare(b)`, and optionally reversed for descending order, then joined with a single space.

Sentence Sorter Use Cases

  • Alphabetizing sentences in a pasted passage for review
  • Grouping similar statements together for comparison
  • Producing a deterministic sentence order for a report

Common Mistakes

  • Expecting paragraph breaks to be preserved; all sentences are rejoined into one block.
  • Sorting text containing abbreviations, where the splitter produces fragments that then sort as though they were complete sentences.

Tips

  • Run Sentence Filter first if you only want to sort a subset of sentences matching a keyword.
  • Alphabetical order groups sentences sharing an opening, which makes repeated sentence starts easy to spot when editing for variety.

References

Frequently Asked Questions