A list containing Shelf 2, Shelf 10, and Shelf 1 can be arranged in two useful ways. Alphabetical order compares the digit characters as part of the label, putting Shelf 10 before Shelf 2. Numeric order compares digit groups by their value, so it puts Shelf 2 before Shelf 10. The TinyToolbox Sort Lines tool lets you choose either method in ascending or descending order.
The tool sorts each complete line. Use it for labels and records whose ordering can be determined by the text at the start of each row. If a row begins with a date and ends with a name, sorting the full row ordinarily starts with the date. To sort by the name instead, use a worksheet with separate columns or prepare a working copy with the intended key first.
Sort an example list
- Open Sort Lines Alphabetically.
- Paste your list into Input text, using one entry per line.
- Choose a mode in Sort order.
- Select Run tool.
- Review the result and select Copy result.
Try the lines Shelf 2, Shelf 10, and Shelf 1. With Ascending alphabetical, they become Shelf 1, Shelf 10, and Shelf 2. With Ascending numeric, they become Shelf 1, Shelf 2, and Shelf 10. Use the sample to confirm your choice before processing a longer list.
The descending modes reverse the direction of comparison. Select Descending numeric for the largest shelf number first in this sample. Select Descending alphabetical if you need reverse text order. After changing the mode, run the tool again before copying. The result belongs to the last completed run, so check its first few lines against the selected mode.
Choose alphabetical order for text labels
Alphabetical order works well for a plain list of names or headings. For example, enter Market entrance, Library desk, and Harbor office on separate lines. Ascending alphabetical order puts Harbor first, Library second, and Market third. The entire phrase remains on its line. The tool moves the rows and does not rearrange words inside them.
If two lines begin alike, later text helps determine where they go. For a list containing Harbor office and Harbor gate, the second word distinguishes the rows. If your real instruction is to sort locations by a particular word such as the department name or surname, put that key first in a temporary copy or use a tool that can sort a separate column.
The comparison uses the browser’s locale-sensitive ordering. Accents, case, and punctuation may be ordered according to the browser’s default locale. If your list must follow a specific dictionary or a published catalog’s sorting rules, include a few representative labels with accents or punctuation in your test. Compare the output with the standard you need before applying it to the full list. The tool has no separate locale selector.
Understand what numeric order does with filenames
Numeric order is useful for text with digit groups. Imagine you have these assets:
panel-11.png
panel-2.png
panel-1.png
panel-20.png
Ascending numeric order produces panel-1.png, panel-2.png, panel-11.png, and panel-20.png. The shared text makes the digit group the deciding part of the comparison. The filenames remain unchanged, including the punctuation and extension. Copying this output changes how the names are listed in your document. It does not rename the files on your device.
Where there are multiple digit groups, the comparison proceeds through the line. For example, try Section 3 item 12, Section 3 item 2, and Section 2 item 20. Numeric ascending puts Section 2 first, then the two Section 3 entries in item order. It does not find the last number in every row and use that as the primary key. If you want the item number to control the order across sections, use it as a separate key.
Leading zeros can also matter. Under numeric comparison, digit groups like 2 and 02 can compare as equal when the surrounding labels match. The tool keeps both rows. If those spellings identify distinct objects, preserve them as written and check how you want ties handled before using the resulting order.
Keep signed values and decimals in a numeric column
The numeric mode compares digit groups in text. It does not parse each complete line as a signed number, decimal, currency amount, or date. A minus sign and a decimal point are characters in the comparison. If you need arithmetic order for values such as -3.5, 0.8, and 0.12, use a numeric column or a workflow that interprets those values as numbers.
A filename example shows why that distinction is useful. In draft-2.10 and draft-2.2, the groups after the period are 10 and 2. A version listing may want the 2 group before the 10 group. As decimal numbers, 2.10 and 2.2 have the opposite order. Verify which rule your data requires, especially when the same punctuation appears in both kinds of record.
For dates, a fixed year-month-day representation can make plain alphabetical order useful. For example, 2026-01-25 comes before 2026-11-04 because it uses consistent leading zeros and largest-to-smallest date components. A mixture of dates such as 4 Nov 2026 and 01/25/2026 needs preparation before the sorted result can be read as a timeline. Save the source dates and use one agreed format or an actual date column.
Keep headings and sections out of the sort
Suppose your list begins with Collection points and then names several sites. Copy just the names into the tool, leaving the heading where it belongs. If the heading is included, it sorts like any other line. The same applies to a footer or a row of dashes. A blank line also participates in the comparison, so it can move away from the section it originally separated.
For a document with several groups, sort the body of one group at a time. If two teams each have their own set of asset names, separate queries keep each team’s entries under its heading. If you instead apply one sort to the combined input, the names are compared with each other across groups. Choose the selection by deciding which items belong in the same ordered list.
Spacing is preserved within the lines. A line starting with two spaces can compare differently from the same visible label without indentation. Check whether indentation and tabs represent meaningful structure before changing them. If you only need a uniform name list, clean the source in a separate working copy first. A pasted block that uses single line breaks for records is easiest to check.
Check the sorted result before using it
Compare the number of entries with the input. Sorting keeps repetitions. If the list contains two identical names and you need only one, remove duplicates in a separate step after confirming that both entries really describe the same item. A repeated name can also represent two different records, so check the related information before removing either entry. Remove Duplicate Lines
For a spreadsheet export, verify that each record occupies one physical line before sorting it as text. A quoted field with an embedded line break can span several lines. Sorting those lines would separate pieces of the same record. Use the spreadsheet’s row sort when you need to move whole records and select a specific column as the key.
As a final check, inspect the first and last entries, then compare a pair whose order could be surprising, such as asset 2 and asset 10. Keep the original and the chosen sort mode alongside the result when the order will be reused. For example, “sorted the shelf labels in ascending numeric order, with the heading excluded and repeated labels retained” describes a procedure a colleague can reproduce.
Work through a numbered handoff list
Imagine a facilities team handing over a list of bays. Each line starts with a bay label and ends with a location cue. The team wants the smallest bay number first so a reader can move through the list in sequence.
Bay 2 — south
Bay 10 — main
Bay 02 — south
Bay 1 — desk
Bay 2 — north
Select Ascending numeric and run the tool. In a typical comparison, Bay 1 — desk comes first and Bay 10 — main comes last. The three lines numbered 2 occur between them. The north cue sorts before the south cue when the number compares equal. The two south lines also compare equal in numeric mode because 2 and 02 have the same numerical value and the surrounding text matches. They retain their original relative order, with the unpadded label first.
The sorted list can help the team spot the two spellings side by side. Before changing one, compare both with the source register. If one spelling is deliberate, keep it. If they refer to the same entry and one is a transcription error, correct the source register and sort the revised list. The sorter can bring related lines together, while the register supplies the information needed to decide what those similarities mean.
Now switch to Descending numeric. Bay 10 comes first, Bay 1 comes last, and south sorts ahead of north within the comparable group of Bay 2 entries. The two south lines still retain their original relative order. This is because descending mode reverses the sign of the comparison for each pair and preserves ties. Reversing the already sorted ascending output would instead swap the two tied lines along with everything else. Pick the operation that matches your handoff requirement. Reverse Text
Use consistent prefixes when two keys matter
Suppose you have three records labeled Zone A Item 12, Zone B Item 2, and Zone A Item 3. An ascending numeric sort groups Zone A together first because the zone label appears before the item number. Inside Zone A, Item 3 precedes Item 12. If the team wants Item 2 first regardless of zone, prepare a working copy that starts each record with the item number. Keep the original zone and item association visible so the move can be checked afterward.
For recurring exports, write down the intended primary and secondary keys. For example, “zone first, item number second, description last” explains why Zone A Item 12 precedes everything in Zone B. If a later export switches those columns, running the same sort on the raw text would apply a different ordering. Verify the first line against the layout you expect before sorting the full export.
Try one pair with the same primary key, one with different primary keys, and one with the same number written with different padding. Compare the small output with your expected order. Then sort the full list and confirm that each row’s label and description still travel together. This check is especially useful when the result goes into a printed handoff, where the person reading it cannot see the original export or the selected mode.