Graphing Inequalities on a Number Line Calculator
Enter a linear inequality (ax + b compared to c) and this calculator solves it, plots the solution on a number line with open or closed circles and direction arrows, and shows the answer in interval notation and set-builder notation. Switch to compound mode to intersect or union two inequalities at once. Every step of the algebra is shown so you can follow the working.
What does graphing an inequality on a number line mean?
An inequality like x < 3 does not have a single answer but an entire set of values (all real numbers less than 3). Graphing the inequality on a number line is a way of picturing that infinite set as a shaded ray. You place a circle at the boundary value (3 in this case), shade the region that satisfies the inequality, and add an arrow at the open end to show the solution continues to infinity. The circle is open (hollow) when the boundary is excluded (strict operators < and >) and closed (filled) when the boundary is included (non-strict operators <= and >=). The number line graph makes it visually obvious which values are solutions and which are not.
How to solve and graph a linear inequality step by step
A linear inequality in one variable has the form ax + b op c, where op is one of <, <=, >, or >=. To graph it: 1. Isolate x by treating the inequality like an equation, with one critical difference: if you multiply or divide both sides by a negative number, you must flip the direction of the inequality sign. 2. Place a circle at the boundary value on the number line. Use an open circle for < and >, and a filled circle for <= and >=. 3. Shade the number line in the direction the inequality allows. For x < c or x <= c, shade to the left. For x > c or x >= c, shade to the right. 4. Add an arrowhead to show the ray continues to negative or positive infinity. 5. Write the solution in interval notation, for example (-infinity, 3) for x < 3, or [2, +infinity) for x >= 2.
Compound inequalities: AND vs. OR
A compound inequality links two simple inequalities with the word AND or OR. An AND compound inequality (sometimes written as a three-part inequality like -1 <= x < 3) requires both conditions to hold simultaneously, so the solution is the intersection of the two solution sets - typically a bounded interval on the number line. An OR compound inequality requires only one condition to hold, so the solution is the union of both solution sets - often two separate rays pointing in opposite directions. For example, x < -2 OR x > 4 gives the two rays (-infinity, -2) union (4, +infinity), leaving the middle segment empty.
Interval notation and set-builder notation
Interval notation is a compact way of writing a solution set using brackets and infinity. A square bracket [ or ] means the endpoint is included; a round bracket ( or ) means it is excluded. Infinity is always enclosed in round brackets because it is not an actual number. Examples: (-infinity, 5) is all numbers less than 5; [2, +infinity) is all numbers from 2 onwards including 2; [-1, 3) is all numbers from -1 (included) up to but not including 3. Set-builder notation expresses the same idea as a conditional statement: { x | x < 5 } reads as "the set of all x such that x is less than 5." Both forms are standard in algebra and pre-calculus, and this calculator outputs both automatically.
Inequality symbols and number line conventions
| Symbol | Meaning | Circle at boundary | Arrow direction | Interval notation pattern |
|---|---|---|---|---|
| < | Strictly less than | Open circle (endpoint excluded) | Left | (-∞, c) |
| ≤ | Less than or equal to | Closed circle (endpoint included) | Left | (-∞, c] |
| > | Strictly greater than | Open circle (endpoint excluded) | Right | (c, +∞) |
| ≥ | Greater than or equal to | Closed circle (endpoint included) | Right | [c, +∞) |
Quick reference for how each inequality operator appears on a number line.
Frequently asked questions
When do I use an open circle vs. a closed circle on the number line?
Use an open (hollow) circle when the boundary point is NOT part of the solution. This happens with the strict operators < (less than) and > (greater than). Use a closed (filled) circle when the boundary point IS part of the solution - with <= (less than or equal to) and >= (greater than or equal to). The circle type matches whether infinity sits inside or outside the bracket in interval notation: open circle corresponds to a round bracket, closed circle to a square bracket.
Why does the inequality flip when I multiply or divide by a negative?
When you reverse the sides of an inequality by multiplying or dividing by a negative number, the order of values on the number line reverses. For example, 2 < 3, but multiply both sides by -1 and you get -2 > -3, which requires flipping the sign to remain true. Forgetting this flip is the single most common error when solving linear inequalities by hand. This calculator automatically handles the flip whenever the coefficient of x is negative.
What is interval notation and how does it relate to the number line graph?
Interval notation is a shorthand for writing a range of numbers. A round bracket ( or ) means the endpoint is excluded; a square bracket [ or ] means it is included. Infinity is always written with round brackets because it is not a real number you can reach. The interval notation for x < 3 is (-infinity, 3) - no endpoint included, open circle on the graph. The interval notation for x >= -1 is [-1, +infinity) - endpoint included, closed circle on the graph.
How do I graph a compound AND inequality?
For a compound AND inequality like x > -1 AND x < 4, solve each part separately to get two boundary points (-1 and 4), then shade only the overlap - the region where both conditions are true at once. On the number line, this looks like a segment between the two points rather than two separate rays. In interval notation the result is (-1, 4), meaning all numbers strictly between -1 and 4. Use the Compound AND mode in this calculator to get all of that automatically.
How do I graph a compound OR inequality?
For a compound OR inequality like x < -2 OR x > 5, solve each part and shade each solution set independently. The result is two separate rays on the number line pointing in opposite directions, leaving the middle unshaded. In interval notation: (-infinity, -2) union (5, +infinity). Use the Compound OR mode in this calculator to work this out and see the combined interval.
What is set-builder notation?
Set-builder notation describes a set by stating a rule its members must satisfy. The general form is { x | condition }, read as "the set of all x such that condition is true." For x >= 2 the set-builder form is { x | x >= 2 }, and for -1 <= x < 4 it is { x | -1 <= x < 4 }. It is equivalent to interval notation but spells out the condition explicitly rather than listing the endpoints in a bracket pair.
Can I use this calculator for inequalities with a coefficient on x?
Yes. Enter the coefficient of x (the number multiplying x) and the constant added to x. The calculator solves ax + b op c for x algebraically, including the sign-flip rule when the coefficient is negative, then plots the resulting boundary on the number line.