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

More ways to use this tool

REST API

curl -X POST https://api.iotools.cloud/v1/tool/range-list-tool \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "mode": "expand",
    "input": "1-5, 8, 10-12"
  }'

Swap in your own key from your account. The tool's fields are the body — no wrapper.

Ask an AI agent

Use the IOTools `range-list-tool` tool (Range List Tool) on this input:

YOUR_INPUT_HERE

Paste this at any agent connected to the IOTools MCP server, then add your input.

Embed widget

<iframe
  src="https://iotools.cloud/embed/range-list-tool/"
  width="100%" height="520" frameborder="0" scrolling="no" loading="lazy"
  title="Range List Tool — iotools.cloud"
  sandbox="allow-scripts allow-forms allow-same-origin allow-downloads allow-popups allow-popups-to-escape-sandbox"
  allow="clipboard-write"
  style="width:100%;border:1px solid #e5e7eb;border-radius:12px;overflow:hidden"></iframe>
<script src="https://iotools.cloud/embed.js" async></script>

Drop this into your own page — free, no key required, just a link back.

Cost per callFrom 5 credits

Also available with

Love the tools? Lose the ads.

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