Skip to content
Math

Interval Notation Calculator

Enter two endpoints and choose an interval type (open, closed, or half-open) to get the interval notation, the equivalent inequality, the set-builder form, and the length of the interval. The step-by-step panel shows exactly how each piece of notation is assembled so you can follow the reasoning, not just copy the answer. Results update as you type.

Your details

The smaller boundary of the interval. Use a plain number; the calculator handles -∞ automatically when you choose an unbounded type.
The larger boundary of the interval. Must be greater than or equal to the left endpoint.
Select how the endpoints are treated. Square brackets [ ] include the endpoint; parentheses ( ) exclude it. Infinity is always excluded.
Interval notationClosed interval
[2, 7]

Standard mathematical interval notation with brackets and parentheses.

Equivalent inequality2 ≤ x ≤ 7
Set-builder notation{ x | 2 ≤ x ≤ 7 }
Interval length5
Topology typeClosed
Midpoint4.5

Interval: [2, 7]

  • This interval is equivalent to the inequality: 2 ≤ x ≤ 7.
  • The interval spans 5 units from 2 to 7.
  • The midpoint of this interval is 4.5.

Next stepTo convert back to an inequality, read the brackets: [ means include (use ≤), ( means exclude (use <). Infinity is always paired with a parenthesis.

Formula

[a,b]={xRaxb},length=ba,midpoint=a+b2[a,\,b] = \{x \in \mathbb{R} \mid a \le x \le b\}, \quad \text{length} = b - a, \quad \text{midpoint} = \dfrac{a+b}{2}

Worked example

Inequality: 2 ≤ x < 7. Left side uses ≤, so the left bracket is [. Right side uses <, so the right bracket is ). Interval notation: [2, 7). Length = 7 - 2 = 5. Midpoint = (2 + 7) / 2 = 4.5.

What is interval notation?

Interval notation is a compact, standard way to describe a continuous set of real numbers between two values. Instead of writing a full inequality, you write the two endpoints separated by a comma and surrounded by brackets that show whether each endpoint belongs to the set. A square bracket ([ or ]) means the endpoint is included in the interval; a parenthesis (( or )) means it is excluded. For example, [2, 7) means every real number from 2 up to (but not including) 7 - the same set that the inequality 2 ≤ x < 7 describes. This notation is universal in calculus, real analysis, and pre-calculus courses.

The four types of bounded intervals

Any finite interval falls into one of four categories based on how the endpoints are treated. A closed interval [a, b] contains both endpoints: every number from a to b, a and b included. The equivalent inequality is a ≤ x ≤ b. An open interval (a, b) excludes both endpoints: every number strictly between a and b. The equivalent inequality is a < x < b. A half-open (or half-closed) interval includes one endpoint and not the other. The notation [a, b) means a is included but b is not (a ≤ x < b), and (a, b] means b is included but a is not (a < x ≤ b). The bracket type on each side always matches the direction of the inequality sign for that endpoint.

Unbounded intervals and infinity

When an interval has no upper or lower bound, one or both endpoints are replaced with ∞ (positive infinity) or -∞ (negative infinity). Infinity is not a real number and can never be reached, so it is always written with a parenthesis, never a bracket. The interval (a, ∞) means all real numbers greater than a. The interval (-∞, b] means all real numbers less than or equal to b. And (-∞, ∞) means all real numbers, the entire real line. These show up constantly in domain and range problems in algebra and calculus.

Interval length, midpoint, and set-builder notation

The length of a bounded interval [a, b] is simply b - a, regardless of whether the endpoints are included or not. The inclusion status changes which endpoints belong to the interval but has no effect on length. The midpoint is (a + b) / 2, the number exactly halfway between the two endpoints. Set-builder notation is a third way to describe the same set: { x | 2 ≤ x < 7 } reads "the set of all x such that 2 ≤ x < 7" and is mathematically equivalent to [2, 7). All three forms - interval notation, inequality, and set-builder - describe the same collection of numbers, just in different notations preferred in different contexts.

How to convert an inequality to interval notation

Follow three steps. First, identify the leftmost and rightmost values in the inequality. Second, for each endpoint, check whether the inequality sign is strict (< or >) or non-strict (≤ or ≥): a non-strict sign means the endpoint is included, so use a square bracket; a strict sign means it is excluded, so use a parenthesis. Third, write the left bracket, the left endpoint, a comma, the right endpoint, and the right bracket. For example, -1 < x ≤ 5 becomes (-1, 5]: the left side uses < so a parenthesis, the right side uses ≤ so a square bracket.

Interval notation quick reference

IntervalNotationInequalityEndpoints included?
Closed[a, b]a ≤ x ≤ bBoth a and b
Open(a, b)a < x < bNeither
Half-open (left)[a, b)a ≤ x < ba only
Half-open (right)(a, b]a < x ≤ bb only
Unbounded left(-∞, b)x < bNeither
Unbounded left, closed(-∞, b]x ≤ bb only
Unbounded right(a, ∞)x > aNeither
Unbounded right, closed[a, ∞)x ≥ aa only
All real numbers(-∞, ∞)x ∈ ℝNone (unbounded)

All four bounded interval types, with their bracket rules and equivalent inequalities.

Frequently asked questions

What is the difference between [ and ( in interval notation?

A square bracket [ or ] means the endpoint is part of the interval (included). A parenthesis ( or ) means the endpoint is not part of the interval (excluded). So [3, 8] contains 3 and 8, while (3, 8) does not. This directly corresponds to the inequality signs: [ goes with ≤ or ≥, and ( goes with < or >.

Why is infinity always written with a parenthesis?

Infinity (∞ or -∞) is not a real number - it is a concept describing an unbounded direction. Because you can never actually reach infinity, it makes no sense to include it as an endpoint. By convention, infinity always uses a parenthesis: (a, ∞) not [a, ∞]. Writing [∞] would imply infinity is a concrete value in the set, which is mathematically incorrect.

How do I write all real numbers in interval notation?

All real numbers are written as (-∞, ∞). Both sides are unbounded, so both use parentheses. In inequality form this is sometimes written as x ∈ ℝ (x belongs to the reals). This often appears as the domain of polynomial functions, which are defined for every real number.

What does the length of an interval represent?

The length is the "width" or "measure" of the interval: the total distance from the left endpoint to the right endpoint. For [2, 7] or (2, 7) or any mix of brackets, the length is 7 - 2 = 5. Whether the endpoints are included or not does not change the length, because a single point has zero length. Unbounded intervals (those containing infinity) have infinite length.

How do I convert interval notation back to an inequality?

Read each bracket and apply the matching inequality sign. A [ on the left means the left endpoint is included, so write a ≤ x. A ( on the left means excluded, so write a < x. Apply the same logic to the right side. For example, (-3, 5] converts to: left ( means -3 < x; right ] means x ≤ 5; combined: -3 < x ≤ 5.

What is a half-open interval?

A half-open interval (also called half-closed) includes exactly one endpoint and excludes the other. There are two forms: [a, b) includes a but not b (left-closed, right-open), and (a, b] includes b but not a (left-open, right-closed). Half-open intervals appear frequently in programming (like loop ranges 0 to n-1) and in calculus when describing domains.

Can an interval contain only one number?

Yes, a closed interval where both endpoints are equal, such as [5, 5], contains exactly one point (the number 5). This is called a degenerate interval or a point interval. Open or half-open intervals with equal endpoints, like (5, 5) or [5, 5), represent the empty set because there are no numbers strictly between 5 and 5.

Sources

Written by Dr. Rajiv Menon, PhD Applied Mathematician · Bengaluru, India

Applied mathematician bridging algebraic theory and computational tools for students, engineers, and everyday problem-solvers.

Search 3,500+ calculators

Loading search…