Inequality Solver

Inequality Solver

#cd-inequality-solver { –cd-primary: #1f5eff; –cd-primary-dark: #1747bf; –cd-bg: #f6f8fc; –cd-card: #ffffff; –cd-text: #172033; –cd-muted: #5d6b82; –cd-border: #dbe3f0; –cd-soft: #eef4ff; –cd-error: #b42318; –cd-success: #087443; –cd-warning: #8a4b00; max-width: 1080px; margin: 0 auto; color: var(–cd-text); font-family: inherit; line-height: 1.6; }#cd-inequality-solver * { box-sizing: border-box; }#cd-inequality-solver h2, #cd-inequality-solver h3 { color: var(–cd-text); line-height: 1.25; margin: 0 0 12px; }#cd-inequality-solver p { margin: 0 0 14px; }#cd-inequality-solver .cdineq-intro { margin-bottom: 18px; color: var(–cd-muted); font-size: 1rem; }#cd-inequality-solver .cdineq-badge { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 14px; padding: 5px 10px; border-radius: 999px; background: var(–cd-soft); color: var(–cd-primary-dark); font-size: 0.84rem; font-weight: 700; }#cd-inequality-solver .cdineq-tool { background: var(–cd-card); border: 1px solid var(–cd-border); border-radius: 14px; padding: 18px; box-shadow: 0 10px 30px rgba(23, 32, 51, 0.08); margin-bottom: 24px; }#cd-inequality-solver .cdineq-equation-row { display: grid; grid-template-columns: 1fr 1fr 150px 1fr; gap: 12px; align-items: end; margin: 12px 0 16px; }#cd-inequality-solver .cdineq-field label { display: block; margin-bottom: 6px; font-size: 0.9rem; font-weight: 700; color: var(–cd-text); }#cd-inequality-solver input, #cd-inequality-solver select { width: 100%; min-height: 46px; border: 1px solid var(–cd-border); border-radius: 10px; padding: 10px 12px; font: inherit; color: var(–cd-text); background: #fff; }#cd-inequality-solver input:focus, #cd-inequality-solver select:focus { outline: 3px solid rgba(31, 94, 255, 0.16); border-color: var(–cd-primary); }#cd-inequality-solver .cdineq-actions, #cd-inequality-solver .cdineq-presets { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }#cd-inequality-solver button { border: 0; border-radius: 10px; min-height: 44px; padding: 10px 14px; font: inherit; font-weight: 700; cursor: pointer; }#cd-inequality-solver .cdineq-primary { background: var(–cd-primary); color: #fff; }#cd-inequality-solver .cdineq-primary:hover { background: var(–cd-primary-dark); }#cd-inequality-solver .cdineq-secondary { background: #e9eef8; color: var(–cd-text); }#cd-inequality-solver .cdineq-preset { background: var(–cd-soft); color: var(–cd-primary-dark); font-size: 0.92rem; }#cd-inequality-solver .cdineq-error { display: none; margin-top: 14px; padding: 10px 12px; border-left: 4px solid var(–cd-error); background: #fff1f0; color: var(–cd-error); border-radius: 8px; font-weight: 700; }#cd-inequality-solver .cdineq-result { margin-top: 16px; padding: 16px; border-radius: 14px; background: linear-gradient(135deg, #eef4ff, #f8fbff); border: 1px solid #cfe0ff; }#cd-inequality-solver .cdineq-main-result { font-size: clamp(1.35rem, 3vw, 2rem); font-weight: 800; color: var(–cd-primary-dark); margin-bottom: 6px; overflow-wrap: anywhere; }#cd-inequality-solver .cdineq-result-note { color: var(–cd-muted); margin-bottom: 12px; }#cd-inequality-solver .cdineq-steps { margin-top: 12px; padding: 12px; border-radius: 10px; background: #fff; border: 1px solid var(–cd-border); font-size: 0.95rem; }#cd-inequality-solver .cdineq-steps ol { margin: 0; padding-left: 20px; }#cd-inequality-solver .cdineq-line-wrap { margin-top: 12px; padding: 14px 8px 8px; }#cd-inequality-solver .cdineq-line { position: relative; height: 8px; border-radius: 999px; background: #cbd5e1; overflow: visible; }#cd-inequality-solver .cdineq-ray { position: absolute; top: 0; height: 8px; background: var(–cd-primary); border-radius: 999px; }#cd-inequality-solver .cdineq-ray-left { left: 0; width: 50%; }#cd-inequality-solver .cdineq-ray-right { left: 50%; width: 50%; }#cd-inequality-solver .cdineq-dot { position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; border-radius: 50%; transform: translate(-50%, -50%); border: 3px solid var(–cd-primary); background: #fff; }#cd-inequality-solver .cdineq-dot-filled { background: var(–cd-primary); }#cd-inequality-solver .cdineq-line-label { margin-top: 14px; text-align: center; font-weight: 700; color: var(–cd-muted); }#cd-inequality-solver .cdineq-section { background: var(–cd-card); border: 1px solid var(–cd-border); border-radius: 12px; padding: 18px; margin: 16px 0; }#cd-inequality-solver .cdineq-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }#cd-inequality-solver .cdineq-mini-card { background: var(–cd-bg); border: 1px solid var(–cd-border); border-radius: 10px; padding: 14px; }#cd-inequality-solver ul, #cd-inequality-solver ol { margin-top: 8px; margin-bottom: 0; padding-left: 22px; }#cd-inequality-solver li { margin-bottom: 8px; }#cd-inequality-solver .cdineq-table-wrap { overflow-x: auto; border: 1px solid var(–cd-border); border-radius: 10px; }#cd-inequality-solver table { width: 100%; border-collapse: collapse; min-width: 560px; background: #fff; }#cd-inequality-solver th, #cd-inequality-solver td { border-bottom: 1px solid var(–cd-border); padding: 10px 12px; text-align: left; vertical-align: top; }#cd-inequality-solver th { background: var(–cd-bg); font-weight: 800; }#cd-inequality-solver details { border: 1px solid var(–cd-border); border-radius: 10px; padding: 12px 14px; background: #fff; margin-top: 10px; }#cd-inequality-solver summary { cursor: pointer; font-weight: 800; color: var(–cd-text); }#cd-inequality-solver details p { margin-top: 10px; margin-bottom: 0; color: var(–cd-muted); }#cd-inequality-solver .cdineq-related a { display: inline-flex; margin: 5px 8px 5px 0; padding: 8px 10px; border-radius: 999px; background: var(–cd-soft); color: var(–cd-primary-dark); text-decoration: none; font-weight: 700; }#cd-inequality-solver .cdineq-note { border-left: 4px solid var(–cd-warning); background: #fff8ed; padding: 12px; border-radius: 8px; color: #563000; }@media (max-width: 760px) { #cd-inequality-solver .cdineq-equation-row, #cd-inequality-solver .cdineq-grid { grid-template-columns: 1fr; }#cd-inequality-solver .cdineq-tool, #cd-inequality-solver .cdineq-section { padding: 15px; }#cd-inequality-solver .cdineq-actions button, #cd-inequality-solver .cdineq-presets button { width: 100%; } }

Use this inequality solver to solve a one-variable linear inequality in the form ax + b compared with c, with steps, interval notation, and a simple number line.

Algebra calculator
Less than Less than or equal to Greater than Greater than or equal to
Enter values and click Solve Inequality.
The solver will show the solution set and the key algebra steps.

Quick Result Explanation

The result tells you which values of x make the inequality true. If the answer is x -3, every number greater than -3 works.

For strict signs such as less than or greater than, the boundary number is not included. For less than or equal to or greater than or equal to, the boundary number is included.

Formula and Method

This calculator solves linear inequalities written as:

ax + b compared with c

The method is similar to solving a linear equation:

  1. Move the constant b to the right side: ax compared with c – b.
  2. Divide both sides by a.
  3. If a is negative, reverse the inequality sign.
  4. Write the answer as a solution statement and interval notation.
The most common mistake is forgetting to reverse the inequality sign when dividing or multiplying by a negative number.

How to Use the Inequality Solver

  1. Enter the coefficient of x in the first box.
  2. Enter the constant term that is added to ax.
  3. Choose the inequality sign that matches your problem.
  4. Enter the right side of the inequality.
  5. Click Solve Inequality to see the result, interval notation, and steps.
  6. Use Copy Result if you want to save the visible answer.

Worked Example

Suppose the inequality is 2x + 3 <= 11.

StepWorkReason
Start2x + 3 <= 11Original inequality
Subtract 32x <= 8Move the constant to the right side
Divide by 2x <= 42 is positive, so the sign stays the same
Solutionx <= 4All numbers up to and including 4 work

Common Use Cases

Algebra homework

Check one-variable inequality problems and compare your own steps with the calculator output.

Test preparation

Practice how signs change when the coefficient of x is negative.

Word problems

Model limits such as maximum cost, minimum score, or allowed range using a simple inequality.

Quick checking

Verify whether the solution should point left or right on a number line.

Common Mistakes

  • Not reversing the sign: When you divide by a negative coefficient, less than becomes greater than, and greater than becomes less than.
  • Mixing up strict and inclusive signs: Less than is not the same as less than or equal to.
  • Entering the wrong constant: For 3x – 7 < 8, enter b as -7, not 7.
  • Expecting quadratic results: This tool solves linear inequalities only, not inequalities such as x squared – 4 > 0.
  • Ignoring the no x case: If a is zero, the inequality may be always true or never true.

Limitations

This inequality solver handles one-variable linear inequalities in the form ax + b compared with c. It does not solve compound inequalities, absolute value inequalities, rational inequalities, or quadratic inequalities.

Decimal output may be rounded for readability when the exact value has many digits. For schoolwork, always check whether your teacher expects fractions, decimals, interval notation, or a number line.

Inequality Solver FAQ

What type of inequalities can this calculator solve?

It solves linear inequalities with one variable, such as 2x + 3 18.

When do I reverse the inequality sign?

Reverse the sign when you multiply or divide both sides by a negative number. For example, dividing by -4 changes greater than into less than.

What does interval notation mean?

Interval notation describes the same solution set in a compact form. For example, x <= 4 becomes (-infinity, 4].

Why does the calculator sometimes say all real numbers?

If the x coefficient is zero and the remaining statement is true, then every value of x works because x no longer affects the inequality.

Can this solve quadratic inequalities?

No. Quadratic inequalities need a different method because the solution can contain two intervals or depend on roots of a parabola.

Final Note

This tool is best for checking linear inequality answers quickly while still seeing the algebra behind the result.

(function () { function initCdInequalitySolver() { var root = document.getElementById(“cd-inequality-solver”); if (!root) { return; }if (root.getAttribute(“data-ready”) === “1”) { return; }root.setAttribute(“data-ready”, “1”);var inputA = document.getElementById(“cdineq-a”); var inputB = document.getElementById(“cdineq-b”); var inputC = document.getElementById(“cdineq-c”); var selectOp = document.getElementById(“cdineq-op”); var solveBtn = document.getElementById(“cdineq-solve”); var copyBtn = document.getElementById(“cdineq-copy”); var clearBtn = document.getElementById(“cdineq-clear”); var errorBox = document.getElementById(“cdineq-error”); var mainResult = document.getElementById(“cdineq-main-result”); var resultNote = document.getElementById(“cdineq-result-note”); var stepsBox = document.getElementById(“cdineq-steps”); var lineBox = document.getElementById(“cdineq-number-line”); var presetButtons = root.querySelectorAll(“.cdineq-preset”);function getNumber(input) { return Number(input.value); }function formatNumber(value) { if (!Number.isFinite(value)) { return “not a finite number”; }var rounded = Math.round(value * 10000000000) / 10000000000; if (Object.is(rounded, -0)) { rounded = 0; }return String(rounded); }function getSymbol(code) { if (code === “lt”) { return “<"; } if (code === "lte") { return "”; } return “>=”; }function reverseOperator(code) { if (code === “lt”) { return “gt”; } if (code === “lte”) { return “gte”; } if (code === “gt”) { return “lt”; } return “lte”; }function compareValues(left, code, right) { if (code === “lt”) { return left < right; } if (code === "lte") { return left right; } return left >= right; }function intervalText(code, boundaryText) { if (code === “lt”) { return “(-infinity, ” + boundaryText + “)”; } if (code === “lte”) { return “(-infinity, ” + boundaryText + “]”; } if (code === “gt”) { return “(” + boundaryText + “, infinity)”; } return “[” + boundaryText + “, infinity)”; }function showError(message) { errorBox.textContent = message; errorBox.style.display = “block”; }function clearError() { errorBox.textContent = “”; errorBox.style.display = “none”; }function makeNumberLine(code, boundaryText) { var rayClass = “cdineq-ray-right”; var dotClass = “”;if (code === “lt”) { rayClass = “cdineq-ray-left”; }if (code === “lte”) { rayClass = “cdineq-ray-left”; dotClass = ” cdineq-dot-filled”; }if (code === “gte”) { dotClass = ” cdineq-dot-filled”; }return ‘
Boundary: ‘ + boundaryText + ‘
‘; }function setSteps(items) { var html = “
    “; items.forEach(function (item) { html += “
  1. ” + item + “
  2. “; }); html += “
“; stepsBox.innerHTML = html; }function solveInequality() { try { clearError();var a = getNumber(inputA); var b = getNumber(inputB); var c = getNumber(inputC); var op = selectOp.value;var validChecks = [ inputA.value.trim() !== “”, inputB.value.trim() !== “”, inputC.value.trim() !== “”, Number.isFinite(a), Number.isFinite(b), Number.isFinite(c) ];if (!validChecks.every(Boolean)) { showError(“Please enter valid finite numbers for a, b, and c.”); return; }var original = formatNumber(a) + “x + ” + formatNumber(b) + ” ” + getSymbol(op) + ” ” + formatNumber(c); var epsilon = 0.000000000001;if (Math.abs(a) < epsilon) { var truth = compareValues(b, op, c); lineBox.innerHTML = "";if (truth) { mainResult.textContent = "All real numbers"; resultNote.textContent = "Because the x term is zero, the inequality is true no matter what x is."; setSteps([ "Start with " + original + ".", "Since a = 0, the x term becomes 0x.", "Check the remaining statement: " + formatNumber(b) + " " + getSymbol(op) + " " + formatNumber(c) + ".", "The statement is true, so every real number is a solution." ]); } else { mainResult.textContent = "No solution"; resultNote.textContent = "Because the x term is zero, the inequality is false for every value of x."; setSteps([ "Start with " + original + ".", "Since a = 0, the x term becomes 0x.", "Check the remaining statement: " + formatNumber(b) + " " + getSymbol(op) + " " + formatNumber(c) + ".", "The statement is false, so no value of x can make it true." ]); }return; }var moved = c – b; var boundary = moved / a; var finalOp = op; var signNote = "The coefficient is positive, so the inequality sign stays the same.";if (a < 0) { finalOp = reverseOperator(op); signNote = "The coefficient is negative, so the inequality sign reverses."; }var boundaryText = formatNumber(boundary); var solution = "x " + getSymbol(finalOp) + " " + boundaryText; var interval = intervalText(finalOp, boundaryText);mainResult.textContent = solution; resultNote.textContent = "Interval notation: " + interval; lineBox.innerHTML = makeNumberLine(finalOp, boundaryText);setSteps([ "Start with " + original + ".", "Subtract " + formatNumber(b) + " from both sides: " + formatNumber(a) + "x " + getSymbol(op) + " " + formatNumber(moved) + ".", "Divide both sides by " + formatNumber(a) + ".", signNote, "Solution: " + solution + ".", "Interval notation: " + interval + "." ]); } catch (err) { showError("The calculator could not complete the calculation. Please check the values and try again."); } }function copyResult() { clearError();var text = mainResult.textContent + "\n" + resultNote.textContent + "\n" + stepsBox.textContent; if (text.trim() === "") { showError("There is no result to copy yet."); return; }if (navigator.clipboard) { navigator.clipboard.writeText(text).then(function () { resultNote.textContent = "Result copied. " + resultNote.textContent; }).catch(function () { fallbackCopy(text); }); } else { fallbackCopy(text); } }function fallbackCopy(text) { var temp = document.createElement("textarea"); temp.value = text; temp.setAttribute("readonly", "readonly"); temp.style.position = "fixed"; temp.style.left = "-9999px"; document.body.appendChild(temp); temp.select();try { document.execCommand("copy"); resultNote.textContent = "Result copied. " + resultNote.textContent; } catch (err) { showError("Copy did not work in this browser. You can select the result text manually."); }document.body.removeChild(temp); }function clearTool() { inputA.value = ""; inputB.value = ""; inputC.value = ""; selectOp.value = "lte"; clearError(); mainResult.textContent = "Enter values and click Solve Inequality."; resultNote.textContent = "The solver will show the solution set and the key algebra steps."; stepsBox.innerHTML = ""; lineBox.innerHTML = ""; }function applyPreset(name) { if (name === "basic") { inputA.value = "2"; inputB.value = "3"; selectOp.value = "lte"; inputC.value = "11"; }if (name === "negative") { inputA.value = "-4"; inputB.value = "6"; selectOp.value = "gt"; inputC.value = "18"; }if (name === "always") { inputA.value = "0"; inputB.value = "5"; selectOp.value = "lt"; inputC.value = "9"; }solveInequality(); }solveBtn.addEventListener("click", solveInequality); copyBtn.addEventListener("click", copyResult); clearBtn.addEventListener("click", clearTool);presetButtons.forEach(function (button) { button.addEventListener("click", function () { applyPreset(button.getAttribute("data-preset")); }); });solveInequality(); }if (document.readyState === "loading") { document.addEventListener("DOMContentLoaded", initCdInequalitySolver); } else { initCdInequalitySolver(); } })();

Similar Calculations