Skip to main content

Range List Tool

Expand compact number ranges (10-12, 8, 20) into a full sorted list, or collapse a list of numbers back into compact ranges. Automatically sorts and deduplicates in both directions.

Input

Comma, space or newline separated. In "Expand" mode, tokens may be a range like "10-12".

Output

Result
Was this helpful?

Guides

The Range List Tool converts between two ways of writing a set of numbers: a compact range notation like 1-5, 8, 10-12 and the full, individual list 1, 2, 3, 4, 5, 8, 10, 11, 12. It works in both directions, so you can expand a shorthand range into every value, or collapse a long list of numbers back into a short, readable range string.

How to use it

  1. Choose a mode: Expand ranges → full list or Collapse list → ranges.
  2. Paste your numbers or ranges, separated by commas, spaces or newlines.
  3. Read the result, plus a count of how many numbers or ranges came out. Copy it or download it as a text file.

In Expand mode, each token can be a single integer (8) or an inclusive range (10-12). In Collapse mode, every token must be a plain integer — the tool sorts them and groups consecutive runs into ranges automatically.

Does it handle duplicates and out-of-order input?

Yes, in both directions. Overlapping ranges, repeated numbers and unsorted input are all deduplicated and sorted before the result is built, so 5, 1-3, 3, 2 expands to 1, 2, 3, 5 rather than a messy re-print of the input.

Is there a size limit?

Expansion is capped at 100,000 numbers, so an accidental huge range like 1-999999999 fails fast with a clear message instead of freezing the page.

Does it support negative numbers?

Yes — both modes accept negative integers, e.g. -3-2 expands to -3, -2, -1, 0, 1, 2.

Privacy

This tool runs entirely in your browser. Nothing you enter is uploaded, logged or stored.

number rangerange expanderrange collapsersequencelistnumber list

Love the tools? Lose the ads.

One payment clears every ad from your account, for good. No subscription, no tracking.