Inequality Calculator – Every Answer on a Number Line, Flip Rule Included
An equation has one answer; an inequality has a whole stretch of them. Type a linear inequality — simple, compound, or wrapped in absolute-value bars — and this calculator solves it step by step with exact fractions, highlights the one move everyone gets wrong (dividing by a negative flips the sign), and draws the answer on a number line with the interval notation to match, so the symbol form, the picture and the brackets all tell the same story.
Your inequality
Leave the right x coefficient at 0 for the classic one-sided form like 2x + 3 > 7. Fractions (3/4), mixed numbers (1 1/2) and decimals all work in any box.
Whatever you do to one part, you do to all three. If the x coefficient is negative, both signs flip — watch for the amber step.
A “less than” splits into a chain between −c and c. A “greater than” splits into two separate rays joined by OR.
Private by design: the solving happens in your browser, on this page. Nothing is saved or sent anywhere.
The solution
On the number line
Step by step
See it, then test it
The same solution, drawn large — and a checker that lets you drop any value into the original inequality to watch it pass or fail.
Related calculators
- Solving works like an equation: gather the x terms on one side and the plain numbers on the other — then divide, watching the sign.
- Dividing or multiplying by a negative flips the inequality around. It is the single most common error in this topic, so the calculator flags it in amber.
- Every answer reads three ways — as symbols, as a shaded number line and as interval notation — three spellings of one solution set.
How it works
Gather the x terms
Whatever holds an x moves to one side; the plain numbers move to the other — exactly like solving an equation.
Divide — and watch the sign
Dividing (or multiplying) by a negative flips the inequality around. It is the single most common error in this topic, so the calculator flags it in amber.
Read it three ways
The answer as symbols, as a shaded number line and as interval notation — three spellings of one solution set.
The rules of the road
Adding or subtracting anything: the sign stays. · Multiplying or dividing by a positive: the sign stays. · Multiplying or dividing by a negative: the sign flips.
Worked example — the flip, in plain sight. Solve −3x ≤ 12. Divide both sides by −3. Because the divisor is negative, ≤ must turn around: x ≥ −4. Sanity-check with a number from the answer, say 0: −3 · 0 = 0 ≤ 12, true. And a number outside, say −5: −3 · −5 = 15 ≤ 12 is false — exactly as it should be. If the sign had not flipped, the answer would have wrongly claimed x ≤ −4, and −5 would have “passed” a test it actually fails.
Worked example — a compound. Solve −5 < 2x − 1 ≤ 7. Add 1 to all three parts: −4 < 2x ≤ 8. Divide all three parts by 2 (positive, no flip): −2 < x ≤ 4 — in interval notation, (−2, 4].
A note on quadratics: this calculator solves linear inequalities, compound chains and absolute-value inequalities. A quadratic inequality (with an x² term) needs a sign chart over its two roots — a different tool — so if your problem has an x², this page will say so plainly rather than pretend.
Going deeper
Because multiplying by −1 turns the number line around. 2 < 5 is true; multiply both by −1 and you get −2 and −5 — and on the number line −2 now sits to the right of −5, so −2 > −5. The order genuinely reversed, so the symbol must reverse with it to stay truthful. Dividing by a negative is the same move in disguise: dividing by −3 is multiplying by −1/3, one flip included. Any solve that skips the flip produces an answer that fails its own test values — try x = 0 in the worked example above and watch a non-flipped answer collapse.
Four notations, one idea: does the boundary itself count as a solution? A strict inequality (< or >) excludes it — an open circle on the graph, a parenthesis in interval notation: (2, ∞). An inclusive one (≤ or ≥) includes it — a closed, filled circle, a square bracket: [−4, ∞). Chains mix them freely: −2 < x ≤ 4 is open on the left, closed on the right, and written (−2, 4]. Infinity always takes a parenthesis, because infinity is not a number you can ever reach, let alone include.
Three modes, three kinds of answer
This calculator has three modes, simple, compound and absolute value, and they answer three different kinds of question, so the first skill in using it is choosing the mode that matches the question you actually asked. The simple mode solves one inequality in one unknown, such as 2x + 3 > 7. The compound mode solves two inequalities joined together, such as −5 < 2x − 1 ≤ 7, where x must satisfy both at once. The absolute-value mode solves an inequality containing a modulus, such as |x − 3| < 5, where the distance from a centre matters more than the direction. All three modes were run through this page’s own calculator for the examples below, so every solution and interval can be reproduced by typing the same numbers in and, for the compound and absolute modes, pressing the mode button first.
Simple mode first, with the default: 2x + 3 > 7. Subtract 3 from both sides to get 2x > 4, then divide by 2 to get x > 2, and the calculator displays exactly that, with the interval notation (2, ∞) and the explanation that every number greater than 2 works and 2 itself does not. The test value shown alongside, 5, confirms it in the calculator’s own way: 5 gives 13 > 7, which is true, and 5 is in the solution. Change one thing, the coefficient of x, from 2 to −2, keeping 3 and 7 and the greater-than sign, and the answer becomes x < −2, with interval (−∞, −2). The steps are the same until the division: −2x + 3 > 7 gives −2x > 4, and dividing by a negative reverses the inequality, so x < −2, not x > −2. That reversal is the single most common error in this topic, and the calculator flags the division step whenever it happens, because a solution with the sign the wrong way round is not approximately right, it is the opposite set of numbers. A milder variant shows the same steps without the flip: 2x + 3 > 3 gives 2x > 0 and x > 0, with interval (0, ∞), and the boundary moves from 2 to 0 while the shape of the answer stays the same.
Compound mode joins two conditions, and its default is −5 < 2x − 1 ≤ 7. Solve the left half, −5 < 2x − 1, by adding 1 to get −4 < 2x and dividing by 2 to get x > −2. Solve the right half, 2x − 1 ≤ 7, by adding 1 to get 2x ≤ 8 and dividing by 2 to get x ≤ 4. The answer is the overlap of the two halves, −2 < x ≤ 4, with interval (−2, 4], and the calculator describes it as a single unbroken run of answers, which is the right image: compound AND means both conditions at once, so the solution is the stretch where they agree. A cleaner variant, with the compound fields set to 0, 1, 0 and 10 under the same less-than and less-than-or-equal signs, gives 0 < x ≤ 10, with interval (0, 10], by the same two steps, and it is a good check that you have understood the mode: the low bound comes from the left inequality alone, the high bound from the right inequality alone, and neither bound can be read off without solving its own half. Compound OR, by contrast, would give two separate runs, everything below one bound or above another, and this calculator’s compound mode is the AND form, as its default shows.
Absolute-value mode turns a distance question into a compound question, and its default shows how. |x − 3| < 5 asks which numbers are less than 5 away from 3, and the answer is the stretch from 2 below 3 to 2 above it in the other direction: −2 < x < 8, with interval (−2, 8). The rule is that |x − a| < b, with b positive, is equivalent to −b < x − a < b, so −5 < x − 3 < 5, and adding 3 throughout gives −2 < x < 8. A variant with the fields set to 2, 0 and 6 under a less-than sign, |2x| < 6, gives −3 < x < 3, with interval (−3, 3), by dividing the whole distance inequality by 2 first, or equivalently by solving −6 < 2x < 6 and dividing throughout by 2. The absolute-value mode is therefore not a fourth kind of algebra; it is the compound mode with the two bounds generated symmetrically from a centre and a radius, and recognising that symmetry is what makes absolute-value inequalities quick rather than confusing.
Reading the answer three ways: symbols, number line, interval
Every solution on this page is shown three ways, and the three ways are not decorations; they are checks on each other, and a solution that cannot be translated between them is a solution you have not yet understood. The symbolic form, x > 2 or −2 < x ≤ 4, is the form you work with algebraically. The number-line form shades the solution on a line, with open and closed circles marking the boundaries, and it is the form that makes the shape of the answer visible at a glance: a single run stretching to infinity, a finite stretch between two bounds, or, for compound OR problems, two separate runs. The interval form, (2, ∞) or (−2, 4], is the compact form used in textbooks and in later mathematics, and it encodes exactly the same information as the other two, provided you read its brackets correctly.
The bracket rules are few and absolute, and the page’s own guide states them plainly. An open circle, and a parenthesis in interval notation, mean the boundary value is excluded: the inequality is strict, < or >, and the boundary number itself is not a solution. A closed, filled circle, and a square bracket, mean the boundary value is included: the inequality is ≤ or ≥, and the boundary number is itself a solution. Infinity always takes a parenthesis, because infinity is not a number you can ever reach, let alone include, so (2, ∞) is correct and [2, ∞] would be nonsense, however tempting the symmetry of the brackets looks. Chains mix the two freely: −2 < x ≤ 4 is open on the left, closed on the right, and written (−2, 4], with the parenthesis matching the strict less-than on the left and the square bracket matching the less-than-or-equal on the right. If you can write a solution in all three forms and have them agree, you have checked your own work twice over; if they disagree, the disagreement locates the error, usually at a boundary, where an open circle has been drawn for a ≤ problem or a bracket has been closed for a strict one.
Testing a value is the fourth check, and the calculator provides one explicitly: type a test number and it reports whether that number satisfies the original inequality and whether it lies in the solution. The default test, 5 in the solution x > 2, gives 13 > 7, which is true, and 5 is in the solution. The habit to take from this is to test three kinds of numbers whenever you solve by hand: one clearly inside the solution, one clearly outside it, and the boundary value itself. For x > 2, test 5 (inside, true), test 0 (outside, false, since 3 > 7 is false) and test 2 itself (boundary, false for a strict inequality, since 7 > 7 is false). If all three behave as your solution predicts, the solution is almost certainly right; if the boundary behaves unexpectedly, check whether the inequality was strict or inclusive before you check anything else, because boundary errors are the most common and the easiest to overlook.
When x cancels, and what no solution really means
Sometimes the algebra removes x entirely, and the page’s own frequently asked question gives both cases, because they look like failures and are in fact complete answers. If gathering the terms leaves a true statement about numbers, such as x < x + 3 reducing to 0 < 3, then every real number is a solution: no value of x can break a statement that does not mention x and is true. The solution set is all real numbers, written (−∞, ∞), and the number line is shaded everywhere. If gathering the terms leaves a false statement, such as 5x ≤ 5x − 1 reducing to 0 ≤ −1, then no number works, and the answer is no solution, written with the empty-set symbol, and the number line is shaded nowhere. Neither case is an error in the calculator, and neither case means the problem was badly posed; they are what inequalities do when the x terms happen to cancel, and the calculator reports both cases in plain words instead of inventing a boundary that is not there.
Those two cases also explain why the sign-flip rule matters so much, and why it is worth stating once more in its general form: multiplying or dividing both sides of an inequality by a negative number reverses the order of the number line, because 2 is less than 5 but −2 is greater than −5, so the symbol has to turn around to keep the statement true. Multiplying or dividing by a positive number leaves the order alone, and adding or subtracting any number leaves it alone as well. The flip happens exactly when the multiplier is negative, and at no other step, so when a solution looks wrong, the first place to check is the division step and the sign of the divisor. The calculator highlights that step in amber whenever it occurs, and the habit of checking the divisor’s sign before trusting a solution will save more marks, and more real-world errors, than any other single habit in this topic.
A final word on scope keeps this page honest. The calculator solves linear inequalities in one unknown, compound AND inequalities and absolute-value inequalities of the forms shown, and it reports the solution in symbols, on a number line and in interval notation, with a test value to check against. It does not solve quadratic inequalities, where the solution set can be two separate runs or a single interval depending on the sign of the quadratic, and the page’s own frequently asked question says so; a quadratic inequality needs a sign chart or a graph, and forcing it through a linear solver would give a confidently wrong answer. Within its scope, though, the calculator is exact: it works with the numbers you enter, it flips the sign exactly when the divisor is negative, and it never invents a boundary. Use it to check your hand working, test the three kinds of values, translate the answer into all three forms, and the inequalities that once felt slippery will start to feel like the most checkable algebra there is.
Translating between intervals, symbols and the number line
The translation table below collects every solution produced by this page’s calculator in the guide above, in all three forms, so you can use it as a dictionary whenever a solution arrives in one form and you need it in another. Read each row across, and check that the bracket, the circle and the symbol all say the same thing about the same boundary: a parenthesis, an open circle and a strict sign always travel together, and a square bracket, a closed circle and an inclusive sign always travel together.
| Symbols | Interval | Left boundary | Right boundary |
|---|---|---|---|
| x > 2 | (2, ∞) | 2 excluded | Infinity, always excluded |
| x < −2 | (−∞, −2) | Infinity, always excluded | −2 excluded |
| x > 0 | (0, ∞) | 0 excluded | Infinity, always excluded |
| −2 < x ≤ 4 | (−2, 4] | −2 excluded | 4 included |
| 0 < x ≤ 10 | (0, 10] | 0 excluded | 10 included |
| −2 < x < 8 | (−2, 8) | −2 excluded | 8 excluded |
| −3 < x < 3 | (−3, 3) | −3 excluded | 3 excluded |
Two rows in that table deserve a second look, because they are the ones students most often misread. The compound row, −2 < x ≤ 4 written as (−2, 4], mixes the brackets deliberately: the parenthesis on the left matches the strict less-than, and the square bracket on the right matches the less-than-or-equal, so the interval’s shape is itself a record of which inequality was strict. The absolute-value rows, (−2, 8) and (−3, 3), are both fully open, because a strict absolute-value inequality, less-than with no equality, excludes both of its bounds, and the symmetry of the interval around its centre, 3 for the first and 0 for the second, is the visual signature of a distance problem: the centre is the midpoint of the two bounds, and the radius is half their distance apart, 5 for the first and 3 for the second. If an absolute-value answer comes out asymmetric, something has gone wrong in the translation, because a distance from a centre is symmetric by definition.
The test-value table below completes the checking system, using the default simple inequality, 2x + 3 > 7, with solution x > 2. It lists one value inside the solution, one outside it, and the boundary value itself, with the original inequality evaluated at each, so that the three behaviours, true, false and boundary-false, can be seen side by side. The boundary row is the one that decides between a correct solution and a nearly correct one: for a strict inequality the boundary is false, and for an inclusive inequality the same boundary value would be true, so a test that only checks inside and outside values, without ever testing the boundary, cannot distinguish x > 2 from x ≥ 2, and those two answers differ at exactly one number, which is exactly the number an examiner will test.
| Test value | Original inequality evaluated | True or false | In the solution x > 2 |
|---|---|---|---|
| 5 (inside) | 2 × 5 + 3 > 7, that is 13 > 7 | True | Yes |
| 0 (outside) | 2 × 0 + 3 > 7, that is 3 > 7 | False | No |
| 2 (boundary) | 2 × 2 + 3 > 7, that is 7 > 7 | False | No, boundary excluded |
Carry those two tables with you, and the rest of this topic becomes translation rather than invention: solve by the steps the calculator shows, write the answer in symbols, convert it to interval notation by the bracket rules, draw it with open and closed circles to match, and test an inside value, an outside value and the boundary itself. If all four presentations agree, the answer is right, and if any one disagrees, it points at the step that needs redoing, most often a sign flip or a boundary bracket, rather than leaving you to redo the whole problem blind.
The sign flip, and how to stop missing it
One rule separates inequalities from equations: multiplying or dividing by a negative number reverses the inequality sign. Start from 2 < 5, multiply by −1, and the true statement is −2 > −5, not −2 < −5. Everything else — adding, subtracting, multiplying or dividing by positives — behaves exactly like equations. Two habits prevent nearly every error: circle the flip in your working whenever it happens, and check your answer by substituting one number from inside the solution and one from outside it into the original inequality.
Compound and absolute-value: shape first, algebra second
Before computing, decide the shape of the answer. A compound “and” gives an interval (the overlap); a compound “or” gives two rays (the union). An absolute-value “less than” gives a single interval (|x| < a becomes −a < x < a); an absolute-value “greater than” gives two rays (|x| > a becomes x < −a or x > a). If your algebra produces the wrong shape — a single interval where two rays belong — the algebra is wrong however neat it looks. Shape first, then solve, then check by substitution.
Frequently asked questions
Why does the inequality sign flip when I divide by a negative?
Multiplying or dividing by a negative reverses the order of the number line: 2 is less than 5, but −2 is greater than −5. To keep the statement true, the symbol has to turn around — greater-than becomes less-than and ≤ becomes ≥. This calculator highlights the flip step in amber whenever it happens, because it is the most common source of wrong answers in the whole topic.
What is the difference between an open and a closed circle on the number line?
A closed (filled) circle means the boundary value is itself a solution — the inequality is ≤ or ≥, and interval notation uses a square bracket. An open (hollow) circle means the boundary is excluded — the inequality is strict, < or >, and interval notation uses a parenthesis. Every value past the circle on the shaded side is a solution either way.
How do I write the answer in interval notation?
Write the stretch of the number line from its left end to its right end, using a square bracket where the endpoint is included and a parenthesis where it is excluded or where the stretch runs forever. So x > 2 becomes (2, ∞), x ≥ −4 becomes [−4, ∞), and −2 < x ≤ 4 becomes (−2, 4]. Two separate stretches, like the answer to an absolute-value “greater than”, are joined with the union symbol ∪.
Can this calculator solve a quadratic inequality?
Not in this version, and it will tell you so rather than guess. A quadratic inequality — one with an x² term, like x² − 5x + 6 > 0 — is solved with a sign chart: find the two roots, then test which of the three regions they create satisfies the inequality. This calculator covers linear inequalities, compound chains and absolute-value inequalities, which is where the sign-flip rule does its work.
What is the difference between a compound AND and an OR inequality?
A chain like −5 < 2x − 1 ≤ 7 is an AND: x must satisfy both halves at once, so the answer is the single stretch where they overlap. An OR, which appears when an absolute value is greater than something — |2x + 1| ≥ 7 giving x ≥ 3 or x ≤ −4 — is satisfied by either branch, so the answer is two separate stretches pointing away from each other.
What does it mean when the x cancels out completely?
Sometimes gathering the terms leaves no x at all, and the inequality becomes a bare statement about numbers. If that statement is true — as in x < x + 3, which reduces to 0 < 3 — then every real number is a solution. If it is false — as in 5x ≤ 5x − 1, which reduces to 0 ≤ −1 — then no number works, and the answer is “no solution”. The calculator reports both cases in plain words instead of inventing a boundary that is not there.
How do I test whether my answer is right?
Test three kinds of numbers: one clearly inside the solution, one clearly outside it, and the boundary value itself. For the default answer x > 2, test 5, which gives 13 > 7, true, and is in the solution; test 0, which gives 3 > 7, false, and is outside; and test 2 itself, which gives 7 > 7, false, because a strict inequality excludes its boundary. If all three behave as your solution predicts, the solution is almost certainly right, and if the boundary misbehaves, check strict versus inclusive before anything else.
Why does compound AND give one stretch, not two?
Because AND means both conditions at once, so the solution is the overlap of the two halves. The default compound, −5 < 2x − 1 ≤ 7, gives x > −2 from the left half and x ≤ 4 from the right half, and the overlap is the single stretch −2 < x ≤ 4, written (−2, 4]. Compound OR would give two separate runs, everything below one bound or above another, but this calculator’s compound mode is the AND form, as its default shows.
How do I turn an absolute-value inequality into a compound one?
Use the distance rule: |x − a| < b, with b positive, is equivalent to −b < x − a < b. The default, |x − 3| < 5, becomes −5 < x − 3 < 5, and adding 3 throughout gives −2 < x < 8, written (−2, 8). For |2x| < 6, divide throughout by 2 first, or solve −6 < 2x < 6 and divide by 2, to get −3 < x < 3, written (−3, 3). The absolute-value mode is the compound mode with its two bounds generated symmetrically from a centre and a radius.
What does no solution mean, and what does every number mean?
Both are complete answers that appear when x cancels out. If the remaining statement is true, such as 0 < 3 from x < x + 3, then every real number is a solution, written (−∞, ∞), and the number line is shaded everywhere. If it is false, such as 0 ≤ −1 from 5x ≤ 5x − 1, then no number works, the answer is no solution, and the number line is shaded nowhere. Neither case is an error, and the calculator reports both in plain words instead of inventing a boundary that is not there.
When does the inequality sign flip?
Only when you multiply or divide both sides by a negative number. Adding, subtracting, and positive multiplication or division never flip it.
What is the solution of a compound "and" inequality?
The overlap of the two solutions — an interval. For 2 < x and x < 7, the solution is 2 < x < 7, written (2, 7).
How do absolute-value inequalities split?
|expression| < a becomes −a < expression < a (one interval); |expression| > a becomes expression < −a or expression > a (two rays).
How can I check my answer?
Substitute one number from inside your solution and one from outside it into the original inequality. The inside number must satisfy it; the outside number must fail it.
More calculators
Slope
The steepness between two points, as a fraction and an angle.
½Fraction
Add, subtract, multiply and divide fractions, simplified.
%Percentage
Percent of, percent change and reverse percentages.
🔬Scientific
A full keypad: powers, roots, logs and trigonometry.
▦Matrix
Add, multiply and invert matrices step by step.
📖Solving Inequalities
Compound, absolute-value, and graphing — with the sign-flip rule.
For study and homework checking. Linear, compound and absolute-value inequalities are solved exactly, with fractions kept as fractions; test a value from the answer in the original inequality whenever the stakes matter — if it makes the original statement true, the solution set is right.