Turn 1, 2, 3 into 1-3
Consecutive number range compressor
Shorten long lists of whole numbers into clean ranges, or expand compact ranges back into individual values.
Free browser tool
Compress or expand number ranges
Paste whole numbers separated by spaces, commas, or new lines. Choose Compress to collapse consecutive runs, or Expand to restore every number in a range.
Processed in your browser
Copy or download the result
No account. No signup.
How it works
How to compress consecutive numbers
The tool reads safe whole numbers, finds adjacent runs, and replaces long enough runs with a start and end value.
Paste the values
Use spaces, commas, semicolons, or new lines between whole numbers. Negative numbers are supported.
Choose compress or expand
Compress finds consecutive runs. Expand accepts forms such as 1-4, 8, and 12-10.
Set the range length
Choose how many consecutive values are needed before the tool writes a compact range.
Copy the clean result
The conversion runs locally and the formatted output is ready to copy or download.
Quick example
Compress an ID list
The example turns 1, 2, 3, 7, 8, 9, and 15 into 1-3, 7-9, 15.
Common questions
Number range compressor FAQ
Can the range compressor handle negative numbers?
Yes. It can compress or expand negative whole numbers, including ranges such as -5--2.
Will the tool sort and remove duplicates?
Those options are on by default when compressing. Turn either one off when the original order or repeated values must be preserved.
What does minimum range length mean?
It is the number of consecutive values required before a run becomes a range. With a minimum of three, 4, 5, 6 becomes 4-6 but 9, 10 stays separate.
Are my number lists uploaded?
No. The list is processed in your browser and is not saved unless you turn on Remember on this device or download a backup.