Text Tools

Sort Lines

Live

Sort, reverse, deduplicate, or shuffle lines of text with optional case and blank-line handling.

About Sort Lines

Sort, reverse, deduplicate, or shuffle lines of text with optional case and blank-line handling. Enter lines to process, operation, case-sensitive sorting, remove duplicate lines, remove blank lines in a purpose-built workspace that keeps related controls together and makes units explicit. Input is split on line boundaries, normalized according to the selected options, and then sorted with locale-aware text or numeric comparison, reversed, or securely shuffled. The result panel reports processed lines, input lines, output lines, duplicates removed with copy-ready values and supporting context. Alphabetical order follows the browser locale. Numeric sorting treats each full trimmed line as a number and places nonnumeric lines after numeric values. Processing stays in your browser and the entered values are not sent to UtilityPages.

Set up Sort Lines

Workspace

Source workbench

Edit the source fields below and inspect the rendered output alongside your work.

Complete the fields to prepare a result.

Enter one item per line.

Choose the operation that matches the calculation.

Turn case-sensitive sorting on or off.

Turn remove duplicate lines on or off.

Turn remove blank lines on or off.

Sort Lines results

Enter the values above, then process lines to see the result.

Sort Lines method

Input is split on line boundaries, normalized according to the selected options, and then sorted with locale-aware text or numeric comparison, reversed, or securely shuffled.

How it works

Input is split on line boundaries, normalized according to the selected options, and then sorted with locale-aware text or numeric comparison, reversed, or securely shuffled. Alphabetical order follows the browser locale. Numeric sorting treats each full trimmed line as a number and places nonnumeric lines after numeric values.

Examples

Sort Lines example

Example input
{
    "lines": "pear\nApple\nbanana\napple",
    "operation": "alphabetical",
    "case_sensitive": false,
    "remove_duplicates": true,
    "remove_blank_lines": true
}
Expected result
{
    "result": "Apple\nbanana\npear",
    "input_line_count": 4,
    "output_line_count": 3,
    "duplicates_removed": 1
}

Privacy

This tool does not store your inputs or results on UtilityPages.org.

Frequently asked questions

How does the Sort Lines work?

Input is split on line boundaries, normalized according to the selected options, and then sorted with locale-aware text or numeric comparison, reversed, or securely shuffled.

What information should I enter in the Sort Lines?

Enter lines to process, operation, case-sensitive sorting, remove duplicate lines, remove blank lines. Use values from the same scenario and keep measurement units consistent with the labels shown.

What results does the Sort Lines provide?

The result workspace reports processed lines, input lines, output lines, duplicates removed. Supporting values are included so the primary result can be checked and interpreted.

How exact is the Sort Lines?

Alphabetical order follows the browser locale. Numeric sorting treats each full trimmed line as a number and places nonnumeric lines after numeric values.