Key facts
- A square bracket [ ] means the endpoint is included; a parenthesis ( ) means it is excluded.
- −2 ≤ x < 5 is written [−2, 5): −2 is included, 5 is not.
- Infinity always gets a parenthesis: x ≥ 2 is [2, ∞), x < 0 is (−∞, 0).
- Unions use ∪: x < 0 or x ≥ 4 is (−∞, 0) ∪ [4, ∞).
- All real numbers is (−∞, ∞); the empty set is ∅.
Reading and writing interval notation
| Inequality | Interval | Type |
|---|---|---|
| a < x < b | (a, b) | Open |
| a ≤ x ≤ b | [a, b] | Closed |
| a ≤ x < b | [a, b) | Half-open |
| a < x ≤ b | (a, b] | Half-open |
| x > a | (a, ∞) | Unbounded (a ray) |
| x ≥ a | [a, ∞) | Unbounded (a ray) |
| x < b | (−∞, b) | Unbounded (a ray) |
| x ≤ b | (−∞, b] | Unbounded (a ray) |
| all real numbers | (−∞, ∞) | Whole line |
The smaller number always comes first, and ∞ and −∞ always take parentheses because infinity is not a number that can be reached or included.
How to use the interval notation calculator
- Type an inequality (x ≥ −2, 1 < x ≤ 4), an interval ([2, 5), (-inf, 3]) or a combination such as x > 3 or [0, 4), [1, 5] and (3, 8), or [0, 4) U (5, 7].
- You can type inf or infinity for ∞, and <= or >= for ≤ and ≥.
- Read the interval notation, the inequality, set-builder notation, the interval type, the length and midpoint, and the number line.
Worked examples: interval notation
Example 1: the default
−2 ≤ x < 5. −2 is included (≤), 5 is not (<), so the interval is [−2, 5). Length 7, midpoint 1.5.
Example 2: a ray
x ≥ 2 is [2, ∞): closed at 2, extending forever to the right.
Example 3: from interval to inequality
(−∞, 3] means x ≤ 3.
Example 4: a union
x < 0 or x > 4 is (−∞, 0) ∪ (4, ∞): everything except the closed segment from 0 to 4.
Example 5: an intersection
[1, 5] and (3, 8): the overlap starts just after 3 and ends at 5 (included in both), so the result is (3, 5].
Example 6: overlapping pieces merge
x > 3 or [0, 4) covers everything from 0 onward, so the union simplifies to [0, ∞).
Set-builder notation
Set-builder notation describes the rule: {x | −2 ≤ x < 5} reads "the set of all x such that −2 ≤ x < 5". It is the most flexible form, since it can describe sets that intervals cannot, such as {x | x is an integer}. Interval notation is shorter for continuous ranges.
Where interval notation is used
- Solutions of inequalities: the graphing inequalities calculator solves them and gives the answer in interval notation.
- Domain and range of functions: √x has domain [0, ∞); 1/x has domain (−∞, 0) ∪ (0, ∞).
- Intervals where a function increases or decreases in calculus.
- Tolerances and specifications: a resistor rated 100 Ω ± 5% lies in [95, 105] Ω.
Unions and intersections
A union ∪ joins sets: a number is in A ∪ B if it is in A or in B. An intersection ∩ keeps only what they share. Overlapping or touching pieces in a union merge into one interval, as in Example 6. Pieces with nothing in common have an empty intersection.
Mistakes to avoid with interval notation
- Using a bracket with infinity, such as [2, ∞]. It is always [2, ∞).
- Writing the larger number first, such as (5, −2).
- Confusing (a, b) with a point. In this context (3, 7) means all numbers between 3 and 7, not the coordinate pair.
- Using ∪ between pieces of an "and" condition, which should be an intersection.
Brackets, parentheses and international conventions
Interval notation describes sets of real numbers compactly: [2, 5) means all numbers from 2 up to but not including 5. A square bracket means the endpoint is included (closed), a parenthesis that it is excluded (open). Infinity always gets a parenthesis, because ∞ is not a number that can be reached; the symbol itself was introduced by John Wallis in 1655.
Conventions differ by country. In France and in the influential books of the Nicolas Bourbaki group, open endpoints are written with reversed square brackets, so (2, 5) becomes ]2, 5, and the international standard ISO 80000-2, which sets mathematical notation for science and engineering, lists that form as an alternative. Set-builder notation, {x | 2 ≤ x < 5}, says the same thing in words and symbols. Intervals are the language of calculus, where functions are continuous or increasing "on an interval", and of statistics, where confidence intervals give a range for an estimate. In US high schools, interval notation is used throughout functions and precalculus courses. Solutions of [absolute value equations and inequalities, such as |x − 3| < 2, are naturally written as intervals, here (1, 5). To graph an inequality on a number line, use the graphing inequalities calculator; for statistical ranges, the confidence interval calculator; and for distances between endpoints, the absolute value calculator.
Related: the absolute value calculator, the absolute value equation calculator and the rounding calculator.
How this calculator works
- Converts between inequalities (such as 2 ≤ x < 5) and interval notation ([2, 5)).
- Square brackets mark included endpoints; parentheses mark excluded endpoints and infinity.
- Shows set-builder notation, the interval type (open, closed, half-open, unbounded), its length and midpoint.
- Unbounded intervals have infinite length and no midpoint.
Frequently asked questions
What is interval notation?
A way to write a range of real numbers with its endpoints, using [ ] for included endpoints and ( ) for excluded ones.
How do you write −2 ≤ x < 5 in interval notation?
[−2, 5).
What does a square bracket mean?
The endpoint is included in the set.
What does a parenthesis mean?
The endpoint is excluded from the set.
Why does infinity always have a parenthesis?
Because infinity is not a real number, so it cannot be included as an endpoint.
How do you write all real numbers?
(−∞, ∞).
What does the ∪ symbol mean?
Union: the set of numbers in either interval, used for "or" conditions.
How is interval notation different from set-builder notation?
Interval notation lists endpoints, like [2, 5); set-builder notation states a rule, like {x | 2 ≤ x < 5}.