Skip to main content
Mathovia

Math / Algebra

Interval Notation Calculator

Type an inequality such as 2x + 3 > 7 or −3 ≤ 2x − 1 < 5, or an interval such as [−2, 5) ∪ (7, ∞). The calculator solves it if needed, writes the answer in interval, inequality and set-builder notation, and graphs it on a number line.

Type <= and >= for ≤ and ≥, != for ≠, and inf for ∞. Join parts with "and" or "or", and intervals with U or ∪.

Interval notation

[−1, 3)
Inequality
−1 ≤ x < 3
Set-builder
{x | −1 ≤ x < 3}
−3−2−1012345−13

filled dot: included [ ] open dot: not included ( ) · arrow: continues to ∞

  1. Add 1 to all three parts−2 ≤ 2x < 6
  2. Divide all three parts by 2−1 ≤ x < 3
Written by
MPhil in Mathematics, Founder of Mathovia
Published

Mathematics verification: Mathematical formulas, calculations, worked examples and solutions are reviewed for accuracy before publication. How we check our work

Interval notation packs a whole range of numbers into a few characters. “Every number from −1 up to, but not including, 3” becomes [−1, 3). It’s how textbooks write the solutions to inequalities, the domain and range of functions, and the regions where a graph rises or falls. This calculator converts in both directions, solves linear inequalities with every step shown, and draws the result on a number line, so the brackets match what you see.

The inequality a less than x less than or equal to b is the interval round bracket a, b square bracket
An inequality and its interval notation

Reading interval notation

Everything comes down to two rules. The smaller endpoint is written first. A square bracket means the endpoint is included, and a round bracket means it’s left out. Infinity is never included, since you can’t stop at it, so it always gets a round bracket.

InequalityInterval notationOn a number line
x > a(a, ∞)open dot at a, arrow right
x ≥ a[a, ∞)filled dot at a, arrow right
x < b(−∞, b)arrow left, open dot at b
x ≤ b(−∞, b]arrow left, filled dot at b
a < x < b(a, b)open dots at both ends
a ≤ x ≤ b[a, b]filled dots at both ends
a ≤ x < b[a, b)filled at a, open at b
every real number(−∞, ∞)the whole line
x ≠ a(−∞, a) ∪ (a, ∞)whole line with a hole at a

The interval notation lesson goes through each of these with worked examples.

How to write an inequality in interval notation (step by step)

The calculator opens on −3 ≤ 2x − 1 < 5, a compound inequality with x in the middle. To write it as an interval, first get x on its own.

Step One: Undo the subtraction in all three parts

Whatever you do to the middle, do to both ends.

−3 ≤ 2x − 1 < 5
−3 + 1 ≤ 2x − 1 + 1 < 5 + 1
−2 ≤ 2x < 6

Step Two: Undo the multiplication

Divide all three parts by 2. It’s positive, so the signs stay the same.

−1 ≤ x < 3

Step Three: Choose the brackets

The left sign is ≤, so −1 is included and gets a square bracket. The right sign is <, so 3 is left out and gets a round bracket.

−1 ≤ x < 3   →   [−1, 3)

Step Four: Check with a test value

Pick a number inside the interval, say x = 0: 2(0) − 1 = −1, and −3 ≤ −1 < 5 is true. Then try the endpoint x = 3: 2(3) − 1 = 5, and 5 < 5 is false, which confirms 3 is excluded.

The solution −1 ≤ x < 3 on a number line with a filled dot at −1 and an open dot at 3, labelled with the square and round brackets of [−1, 3)
A visual read of the worked example above. These are the same numbers the calculator returns for its default inputs.

Dividing by a negative flips the sign

Inequalities follow the same steps as equations, with one extra rule. When you multiply or divide both sides by a negative number, the inequality sign reverses.

−4x + 1 ≥ 9
−4x ≥ 8          subtract 1
x ≤ −2           divide by −4 and flip ≥ to ≤
interval: (−∞, −2]

Check it with x = −3: −4(−3) + 1 = 13, and 13 ≥ 9 is true. Without the flip you’d get x ≥ −2, which fails for x = 0 (1 ≥ 9 is false). The linear inequalities lesson explains why the flip happens.

“And” vs “or”: intersections and unions

Compound inequalities join two conditions, and the joining word changes the answer completely:

x > 0 and x ≤ 10      →  (0, 10]                 both must hold: the overlap
x < −1 or x ≥ 4       →  (−∞, −1) ∪ [4, ∞)       either may hold: the union
x > 5 and x < 2       →  ∅                       nothing is in both
x < 5 or x > 2        →  (−∞, ∞)                 everything is in one or the other

The ∪ symbol is how interval notation writes “or” when there’s a gap. For more on these, see the compound inequalities lesson.

Set-builder notation

Set-builder notation describes the set by its rule instead of its endpoints. It reads “the set of all x such that…”:

{x | −1 ≤ x < 3}       same set as [−1, 3)
{x | x ≠ 3}            same set as (−∞, 3) ∪ (3, ∞)
{x | x ∈ ℝ}            same set as (−∞, ∞)

The calculator gives all three forms, since different teachers and textbooks ask for different ones.

Converting interval notation back to an inequality

Type an interval and the calculator works backwards. Each bracket turns into a sign: [ becomes ≤, ( becomes <, and an infinite end simply drops that side.

[−2, 5) ∪ (7, ∞)   →   −2 ≤ x < 5 or x > 7
(−∞, 4]            →   x ≤ 4

Overlapping or touching intervals are merged automatically: (−1, 3] ∪ [3, 6) is just (−1, 6).

Interval notation for domain and range

Outside of inequality homework, the most common place you’ll meet interval notation is in describing a function’s domain (the inputs allowed) and range (the outputs it produces). Square roots, fractions and squares each leave a recognizable mark:

f(x) = √(x − 2)      domain [2, ∞)              range [0, ∞)
f(x) = 1/(x − 3)     domain (−∞, 3) ∪ (3, ∞)     range (−∞, 0) ∪ (0, ∞)
f(x) = x² + 1        domain (−∞, ∞)              range [1, ∞)

The square root needs x − 2 ≥ 0, which is a one-line inequality, and the calculator turns “x − 2 ≥ 0” into [2, ∞) instantly. The fraction can’t divide by zero, so x ≠ 3, the same two-ray union you get by typing “x ≠ 3”. Reading a range off a graph works the same way. Look at the lowest and highest y-values the graph reaches, and decide whether each end is actually reached (square bracket) or only approached (round bracket).

The domain lesson walks through finding the domain of every common function type, and each answer there is written in exactly this notation.

Later on, calculus uses intervals to describe behavior as well as inputs. “f is increasing on (−∞, −1) ∪ (2, ∞)” means the graph rises everywhere except between −1 and 2. Those endpoints usually get round brackets, because at a turning point the graph is momentarily neither rising nor falling. Getting comfortable with brackets and unions now pays off well beyond inequality chapters.

Common mistakes with interval notation

  1. Putting a square bracket next to infinity. [3, ∞] is wrong. Infinity always takes ( or ).
  2. Writing the larger number first. x < 3 and x > −2 is (−2, 3), not (3, −2).
  3. Forgetting to flip the sign after dividing by a negative.
  4. Mixing up (3, 5) as a point. In interval notation (3, 5) means every number between 3 and 5, not the coordinate point (3, 5). Context tells you which one is meant.
  5. Using ∪ for “and”. “And” is the overlap of the two sets. ∪ is only for “or”.

For practice writing solution sets, the interval notation practice problems generate new questions with answers.

Frequently Asked Questions

What is interval notation?+

A short way to write a range of numbers using its two endpoints. A square bracket means the endpoint is included and a round bracket means it isn't, so [−1, 3) means every number from −1 up to, but not including, 3.

How do you write x > 3 in interval notation?+

(3, ∞). The round bracket shows 3 itself isn't included, and infinity always gets a round bracket because it isn't a number you can reach. x ≥ 3 would be [3, ∞).

When do you use a square bracket vs a parenthesis?+

Square brackets [ ] for ≤ and ≥, where the endpoint is part of the set. Round brackets ( ) for < and >, where it isn't, and always next to ∞ or −∞.

What does the U symbol mean in interval notation?+

∪ means union, or the word or. (−∞, −1) ∪ [4, ∞) is every number less than −1 together with every number from 4 up. It's how you write a set with a gap in it.

How do you write all real numbers in interval notation?+

(−∞, ∞). Its set-builder form is {x | x ∈ ℝ}. An inequality whose variable cancels into something always true, like x + 1 > x, has this as its solution.

How do you write x ≠ 3 in interval notation?+

(−∞, 3) ∪ (3, ∞). It's every real number with 3 removed, which takes two intervals joined by a union, with round brackets at 3 on both sides.

Why does the inequality sign flip when dividing by a negative?+

Multiplying or dividing by a negative reverses the order of numbers: 2 < 5, but −2 > −5. So −4x ≥ 8 becomes x ≤ −2 after dividing by −4. Forgetting the flip is the most common inequality mistake.

Learn and practice this topic

Related calculators