Text & String Utilities100% Client-Side

Sort Lines by the First Number

Paste rows that each contain a numeric value to reorder them by their first number. The tool recognizes a minus sign and ordinary decimal fractions. The entire row moves with the numeric key, so labels and notes stay attached. This works when the first number on each row is the one you want to compare. Check rows that contain several numbers before relying on the order.

Configuration Options
Input
23 chars•3 lines
Output

How to Use the Sort Lines by Their First Number Online

  1. 1Paste one record per line and confirm that its first number is the sorting key you intend to use.
  2. 2Select ascending for smaller numbers first or descending for larger numbers first.
  3. 3Review negative values, decimals, and lines without a recognized number.
  4. 4Copy the complete rows after checking that their order matches the intended numeric field.

Input & Output Examples

Ascending order uses the first number of each row, including the negative decimal.

Input Sample
item 10 points 1
item -2.5 points 30
item 2 points 0
Expected Output
item -2.5 points 30
item 2 points 0
item 10 points 1

Descending order places the row with no number last and preserves the relative order of the tied rows.

Input Sample
no score
run 3 first
run 8
run 3 second
Expected Output
run 8
run 3 first
run 3 second
no score

Practical Developer Workflows

  • Order listed amounts that include negative adjustments and decimals.
  • Sort labels such as run 2 and run 10 without losing their attached descriptions.
  • Build a fixture that shows how tied keys and rows without numbers are placed.

Zero Server Uploads & Complete Privacy

Runs 100% in your browser; no data is uploaded to any server.

Notice a bug, calculation error, or outdated info?

Let us know directly so our engineering team can fix it.

Frequently Asked Questions

The first matched number controls the sort. In batch 2 scored 100, the sorting key is 2. If you need to sort by the score, put it before the batch number or extract the score into a separate field first.

Explore Other Tools

12 suggested tools

View all tools