Input pairs of ranges like [1,4],[3,7]. Visualizes overlaps on a timeline and collapses them into merged segments instantly.
Merging intervals is a sort followed by one comparison, and the comparison is where solutions diverge. Does [1,4] merge with [5,7]? Under the standard definition, no: they touch only if the next start is at or before the previous end. The Interval Merger takes that position by default and offers the other convention as an explicit checkbox rather than choosing silently.
Two timelines are drawn to the same scale, the input intervals in rotating colours above and the merged result beneath. Seeing both on one axis is what makes a partial overlap obvious, since a list of number pairs is exactly the representation the human eye is worst at.
The parser is deliberately relaxed. Brackets, parentheses or nothing at all are accepted, so [1,4],[3,7] and 1,4 3,7both work, and a reversed pair such as [7,3] is quietly corrected to [3,7]. Everything computes in the page.
The default input is [1,4],[3,7],[8,10],[9,12]. Sorting by left endpoint leaves the order unchanged. [3,7] starts at 3 which is at or before 4, so it merges into [1,7]. Next comes [8,10], starting after 7, so a new interval opens. Then [9,12] extends it to [8,12]. The stat cards read 4 input, 2 merged and reduced by 2, and the merged list shows [1, 7] and [8, 12].
[1,4] and [5,7] collapse to [1,7]. Leave it off when you are checking your own output against a judge.[1,10],[2,8],[3,5], which merges to a single [1, 10].[1,10],[2,3] from collapsing to [1,3].Invalid format. Try: [1,4],[3,7] or 1,4 3,7, and a bar narrower than 2% of the axis is widened so a single-point interval stays visible.4
Input intervals
2
Merged intervals
2
Reduced by
Input Intervals (timeline)
Merged Result
Merged Intervals (sorted)