acalculator

How do I write interval notation?

Type an inequality, such as -2 <= x < 6 or x > 4, or an interval in interval notation, such as [-2, 6) or (-inf, 1]. The interval notation calculator writes it in the other forms, says what kind of interval it is, how to draw each end on a number line, and gives its length and midpoint.

Your numbers

Use <= or ≤ for “at most”, and inf or ∞ for infinity.
Interval notation
[−2, 6)

In interval notation it is [−2, 6).

Inequality
−2 ≤ x < 6
Set-builder notation
{x | −2 ≤ x < 6}
Type of interval
half-open and bounded
On a number line
closed (filled) dot at −2; open dot at 6
Length
8
Midpoint
2

Interval notation: [−2, 6). In interval notation it is [−2, 6).

How to calculate

Writes an inequality such as −2 ≤ x < 6 in interval notation, [−2, 6), and interval notation back as an inequality and in set-builder notation, with the length, midpoint and number-line endpoints.

Example with the default inputs (Inequality or interval -2 <= x < 6): In interval notation it is [−2, 6).

Method: A bracket [ ] includes an endpoint (≤ or ≥), a parenthesis ( ) excludes it (< or >), and ±∞ always takes a parenthesis. Length = right − left; midpoint = (left + right) ÷ 2.

  • One interval at a time; unions such as (−∞, 2) ∪ (3, ∞) are not read.
  • In interval notation the comma separates the ends, so numbers there have no thousands separators.
  • The variable is any single letter; the answer uses the letter you typed (x for interval notation).

Machine-readable copies: Markdown, JSON.

Worked examples

Each example is checked against the calculator on every build.

  1. Inequality or interval -2 <= x < 6 gives Interval notation [−2, 6), Set-builder notation {x | −2 ≤ x < 6}, Type of interval half-open and bounded, Length 8, Midpoint 2.Source: OpenStax, Algebra and Trigonometry 2e, §2.7 Linear Inequalities and Absolute Value Inequalities (a bracket includes an endpoint, a parenthesis excludes it, infinity always takes a parenthesis; {x | −2 ≤ x < 6} = [−2, 6), {x | x ≤ 1} = (−∞, 1]), https://openstax.org/books/algebra-and-trigonometry-2e/pages/2-7-linear-inequalities-and-absolute-value-inequalities (retrieved 2026-10-02)
  2. Inequality or interval (-inf, 1] gives Inequality x ≤ 1, Set-builder notation {x | x ≤ 1}, On a number line arrow toward −∞; closed (filled) dot at 1.Source: OpenStax, Algebra and Trigonometry 2e, §2.7 Linear Inequalities and Absolute Value Inequalities (a bracket includes an endpoint, a parenthesis excludes it, infinity always takes a parenthesis; {x | −2 ≤ x < 6} = [−2, 6), {x | x ≤ 1} = (−∞, 1]), https://openstax.org/books/algebra-and-trigonometry-2e/pages/2-7-linear-inequalities-and-absolute-value-inequalities (retrieved 2026-10-02)
  3. Inequality or interval -1 < x < 0 gives Interval notation (−1, 0), Type of interval open and bounded, Length 1, Midpoint -0.5.Source: OpenStax, Algebra and Trigonometry 2e, §2.7 Linear Inequalities and Absolute Value Inequalities (a bracket includes an endpoint, a parenthesis excludes it, infinity always takes a parenthesis; {x | −2 ≤ x < 6} = [−2, 6), {x | x ≤ 1} = (−∞, 1]), https://openstax.org/books/algebra-and-trigonometry-2e/pages/2-7-linear-inequalities-and-absolute-value-inequalities (retrieved 2026-10-02)
  4. Inequality or interval 4 < t gives Interval notation (4, ∞), Inequality t > 4, Type of interval unbounded (a ray), open.Source: OpenStax, Algebra and Trigonometry 2e, §2.7 Linear Inequalities and Absolute Value Inequalities (a bracket includes an endpoint, a parenthesis excludes it, infinity always takes a parenthesis; {x | −2 ≤ x < 6} = [−2, 6), {x | x ≤ 1} = (−∞, 1]), https://openstax.org/books/algebra-and-trigonometry-2e/pages/2-7-linear-inequalities-and-absolute-value-inequalities (retrieved 2026-10-02)
  5. Inequality or interval 1,000 >= x >= -2.5 gives Interval notation [−2.5, 1000], Length 1,002.5, Midpoint 498.75.Source: OpenStax, Algebra and Trigonometry 2e, §2.7 Linear Inequalities and Absolute Value Inequalities (a bracket includes an endpoint, a parenthesis excludes it, infinity always takes a parenthesis; {x | −2 ≤ x < 6} = [−2, 6), {x | x ≤ 1} = (−∞, 1]), https://openstax.org/books/algebra-and-trigonometry-2e/pages/2-7-linear-inequalities-and-absolute-value-inequalities (retrieved 2026-10-02)

How it works

An interval is a set of numbers between a left end a and a right end b. Each end is either included or not:

InequalityInterval notationSet-builder notation
a ≤ x ≤ b[a, b]{x | a ≤ x ≤ b}
a < x < b(a, b){x | a < x < b}
a ≤ x < b[a, b){x | a ≤ x < b}
a < x ≤ b(a, b]{x | a < x ≤ b}
x ≥ a[a, ∞){x | x ≥ a}
x > a(a, ∞){x | x > a}
x ≤ b(−∞, b]{x | x ≤ b}
x < b(−∞, b){x | x < b}
  • a bracket means the end is included (≤, ≥, a closed dot), a parenthesis that it is not (< or >, an open dot); ±∞ always takes a parenthesis and is drawn as an arrow
  • an inequality written the other way round is read the same: 4 < t is t > 4, and 6 > x ≥ −2 is −2 ≤ x < 6
  • length = b − a and midpoint = a ÷ 2 + b ÷ 2, for a bounded interval only
  • type: "closed and bounded" (both ends included), "open and bounded" (neither), "half-open and bounded" (one), "a single point (closed)" ([a, a]), "unbounded (a ray), closed" or "open" (by its finite end), or "all real numbers (unbounded)"

Rules

  • Accepted forms: interval notation [a, b); a double inequality a <= x < b (both signs the same way); x > a, x <= b, a < x; and all real numbers (also all, R or ℝ, in any case). Signs may be typed as <=, ≤, =<, >=, ≥ or =>. For infinity type ∞, inf or infinity, with − for minus infinity.
  • The variable is one letter; interval notation uses x. Numbers are decimals with an optional minus sign (- or −) and an optional exponent (2.5e3). In an inequality a comma may appear only as a thousands separator (1,000); in interval notation the comma separates the ends, so numbers there have none.
  • There is no answer when the left end is greater than the right, when a = b and an end is excluded, when ∞ has a bracket, when −∞ is on the right or ∞ on the left, or when a number is beyond the double-precision range.

Output format. Ends are written with up to 15 significant digits, no thousands separators, and the minus sign "−". Length and midpoint to 12 significant figures. The number line reads "closed (filled) dot at a" or "open dot at a", or "arrow toward −∞" / "arrow toward ∞", left end first, joined with "; ".

Worked examples by hand

−2 ≤ x < 6. −2 is included, 6 is not: [−2, 6), {x | −2 ≤ x < 6}, half-open; length 6 − (−2) = 8, midpoint 2.

(−∞, 1]. x ≤ 1: an arrow toward −∞ and a closed dot at 1.

−1 < x < 0. (−1, 0), open; length 1, midpoint −0.5.

4 < t. Read as t > 4: (4, ∞), an open ray.

1,000 ≥ x ≥ −2.5. Read as −2.5 ≤ x ≤ 1,000: [−2.5, 1000], length 1,002.5, midpoint 498.75.

Other questions people ask

How do I write an inequality in interval notation?

Write the left end, a comma, and the right end. Use a bracket [ or ] where the end is included (≤ or ≥) and a parenthesis ( or ) where it is not (< or >). −2 ≤ x < 6 becomes [−2, 6).

Does infinity get a bracket or a parenthesis?

Always a parenthesis, because infinity is not a number the interval can include. x ≤ 1 is (−∞, 1], and x > 4 is (4, ∞).

What is set-builder notation?

It describes a set by the rule its members follow: {x | −2 ≤ x < 6} reads "the set of x such that x is at least −2 and less than 6". It is the same set as the interval [−2, 6).

What do open and closed dots mean on a number line?

A closed (filled) dot means the end is included, matching a bracket. An open dot means it is not, matching a parenthesis. An end at infinity is drawn as an arrow.

What is a half-open interval?

One end included and the other not, such as [−2, 6) or (3, 7]. A closed interval includes both ends, [a, b]; an open interval includes neither, (a, b).

Can I type x ≠ 3 or a union?

Not yet: the page reads one interval at a time. x ≠ 3 is the union of two intervals, (−∞, 3) ∪ (3, ∞); type each part on its own.