Hex Digit Sorter

For every hex value in a list, sort that value's OWN digits by numeric digit value (ascending or descending), independently, line by line, this reorders the digits inside each value, not the values relative to one another. A free online tool from Staaarter, right in your browser.

Runs locallyUpdated 2026-07-26

Overview

Introduction

Most hex list tools reorder or transform whole values, but sometimes what you want is to rearrange the digits inside a single value, for example seeing what a value looks like with its digits sorted into ascending order.

This tool sorts each hex value's own digits independently, line by line, without ever reordering the values relative to each other in the list.

What Is Hex Digit Sorter?

The Hex Digit Sorter treats each hex value as a small independent sequence of digit characters, and sorts just that sequence by numeric digit value (0 through F), leaving every other value in the list untouched by that operation.

It's the digit-level counterpart to Hex Value Sorter, which reorders entire values in a list instead of the digits within one.

How Hex Digit Sorter Works

For each value in the parsed input list, its digit characters are split apart, sorted by their position in the sequence "0123456789ABCDEF" (ascending or descending as chosen), then rejoined into a string.

Every value is processed this way completely independently: sorting one line's digits never affects any other line.

When To Use Hex Digit Sorter

Use this when you want to see a hex value's digits rearranged into sorted order, for puzzle-style transformations, generating a canonical "smallest possible digit arrangement" for a given multiset of digits, or exploratory tinkering.

If you actually want the list itself reordered by value (not the digits within each value), use Hex Value Sorter instead.

Features

Advantages

  • Processes every value in a list independently, so one value's digit order never leaks into another's.
  • Numeric digit ordering (0-F), not simple character-code ordering, though for hex digits these happen to coincide.
  • Works on lists of any size with the same ascending/descending toggle applied consistently to every value.

Limitations

  • Sorting digits generally changes a value's numeric meaning; this is a rearrangement tool, not a value-preserving one.
  • There's no per-value override, ascending or descending applies uniformly to every value in the list in a single run.

Examples

Ascending digit sort

Input

3F1A
B2C9, order: ascending

Output

13AF
29BC

"3F1A"'s digits (3, F, 1, A) reorder to 1, 3, A, F; "B2C9"'s digits (B, 2, C, 9) reorder to 2, 9, B, C.

Descending digit sort

Input

3F1A
B2C9, order: descending

Output

FA31
CB92

The same two values with each one's digits sorted from highest to lowest instead.

Best Practices & Notes

Best Practices

  • Remember this changes each value's number (unless its digits were already sorted); don't use it expecting a value-preserving transformation.
  • Use Hex Value Sorter, not this tool, whenever your goal is reordering the list rather than a single value's digits.

Developer Notes

Each value is split into individual characters, sorted with a comparator based on `"0123456789ABCDEF".indexOf(digit)` (numeric digit rank, not raw character code, though the two orders coincide for uppercase hex digits), then rejoined; descending order simply reverses the ascending result.

Hex Digit Sorter Use Cases

  • Exploring what a hex value looks like with its digits rearranged into sorted order
  • Generating a canonical minimal or maximal digit arrangement for a fixed multiset of digits
  • Building quiz/puzzle-style hex transformations for testing or teaching purposes

Common Mistakes

  • Confusing this with Hex Value Sorter and expecting the list order to change; only the digits inside each value change here.
  • Assuming the sorted-digit value is numerically related to the original in a simple way; it generally is not.

Tips

  • Sorting a value's digits ascending gives the smallest possible number achievable from that exact multiset of digits (ignoring leading zero conventions); descending gives the largest.
  • Run Hex Number Analyzer on a value before and after sorting to compare their decimal equivalents.

References

Frequently Asked Questions