Text Length Sorter
cross-browser testing tools
World's simplest online line sorter for web developers and programmers. Just paste your text in the form below, press the Sort Lines button, and you get back the same lines but sorted by their length. Press a button – get the text. No ads, nonsense, or garbage.
51K
Announcement: We just added another two new tools categories –
PNG Tools and UTF8 Tools. Check them out!
PNG Tools and UTF8 Tools. Check them out!
Want to sort lines alphabetically?
Use the alphabetic line sorter tool!
Using a String Length Sorter in Cross-browser Testing
A string length sorter can be useful if you're doing cross-browser testing. For example, if you want to neatify the way your web application displays a list of data, then you may want to sort the items so that they go from the shortest item to the longest (or from the longest to the shortest). To make sure your sorting algorithm works correctly, you may also want to write unit tests for it. A unit test is a simple program that takes an algorithm, input data, and output data, then runs the algorithm on the input data, and compares the result with the given output data. This way you can easily catch mistakes in the algorithm. In this program, the algorithm finds lengths of all given strings (one per line) and then sorts them by their length. Another use case for this program is finding the longest (or shortest) string or the longest (or shortest) text line. When you sort lines in ascending order, then the longest line will be the last one at the bottom (and the shortest line will be the first one on top), and if you sort lines in descending order, then the longest line will be the first one on top (and the shortest line will be the last one at the bottom).
Looking for more web developer tools? Try these!
Text Columns to Rows Converter
Text Rows to Columns Converter
Text to HTML Entities Converter
UNIX time to UTC time Converter
UTC time to UNIX time Converter
Seconds to Human Readable Time
Binary Bitwise NAND Calculator
Binary Bitwise XNOR Calculator
Binary Bit Rotator to the Left
Binary Bit Rotator to the Right
Text Character Rotator to the Left
Text Character Rotator to the Right
Number of Letters in Text Counter
Number of Words in Text Counter
Number of Lines in Text Counter
Number of Paragraphs in Text Counter
Decimal to Scientific Converter
Scientific to Decimal Converter
Celsius to Fahrenheit Converter
Pro tip: You can use ?input=text query argument to pass text to tools.