Absolute Value Equation Solver

#cd-absolute-value-equation-solver { –cd-bg: #f6f8fb; –cd-card: #ffffff; –cd-text: #172033; –cd-muted: #5b6578; –cd-border: #dce3ee; –cd-primary: #1f5eff; –cd-primary-dark: #1747bf; –cd-soft: #eef4ff; –cd-success: #0f7a4f; –cd-warning: #9a3412; –cd-error: #b42318; –cd-radius: 14px; color: var(–cd-text); background: var(–cd-bg); padding: 20px; border-radius: var(–cd-radius); box-sizing: border-box; font-family: inherit; line-height: 1.6; }#cd-absolute-value-equation-solver * { box-sizing: border-box; }#cd-absolute-value-equation-solver h2, #cd-absolute-value-equation-solver h3 { color: var(–cd-text); line-height: 1.25; margin: 0 0 12px; }#cd-absolute-value-equation-solver p { margin: 0 0 14px; color: var(–cd-muted); }#cd-absolute-value-equation-solver .cd-abs-tool { background: var(–cd-card); border: 1px solid var(–cd-border); border-radius: var(–cd-radius); padding: 22px; box-shadow: 0 10px 30px rgba(23, 32, 51, 0.08); margin-bottom: 22px; }#cd-absolute-value-equation-solver .cd-abs-label-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }#cd-absolute-value-equation-solver .cd-abs-category { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px; background: var(–cd-soft); color: var(–cd-primary-dark); font-size: 13px; font-weight: 700; }#cd-absolute-value-equation-solver .cd-abs-equation-preview { background: #111827; color: #ffffff; border-radius: 12px; padding: 14px 16px; margin: 16px 0; font-size: 18px; font-weight: 700; overflow-wrap: anywhere; }#cd-absolute-value-equation-solver .cd-abs-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: 14px; }#cd-absolute-value-equation-solver .cd-abs-field { display: flex; flex-direction: column; gap: 7px; }#cd-absolute-value-equation-solver label { font-weight: 700; font-size: 14px; color: var(–cd-text); }#cd-absolute-value-equation-solver input, #cd-absolute-value-equation-solver select { width: 100%; min-height: 46px; border: 1px solid var(–cd-border); border-radius: 10px; padding: 10px 12px; font-size: 16px; color: var(–cd-text); background: #ffffff; }#cd-absolute-value-equation-solver input:focus, #cd-absolute-value-equation-solver select:focus { outline: 3px solid rgba(31, 94, 255, 0.16); border-color: var(–cd-primary); }#cd-absolute-value-equation-solver .cd-abs-help { font-size: 12px; color: var(–cd-muted); }#cd-absolute-value-equation-solver .cd-abs-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }#cd-absolute-value-equation-solver button { border: 0; border-radius: 10px; padding: 12px 16px; min-height: 46px; font-weight: 800; cursor: pointer; font-size: 15px; }#cd-absolute-value-equation-solver .cd-abs-primary { background: var(–cd-primary); color: #ffffff; }#cd-absolute-value-equation-solver .cd-abs-primary:hover { background: var(–cd-primary-dark); }#cd-absolute-value-equation-solver .cd-abs-secondary { background: #e8edf5; color: var(–cd-text); }#cd-absolute-value-equation-solver .cd-abs-secondary:hover { background: #dce3ee; }#cd-absolute-value-equation-solver .cd-abs-presets { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }#cd-absolute-value-equation-solver .cd-abs-preset { background: var(–cd-soft); color: var(–cd-primary-dark); padding: 9px 11px; min-height: 38px; font-size: 13px; }#cd-absolute-value-equation-solver .cd-abs-result { margin-top: 18px; padding: 18px; border-radius: 12px; background: linear-gradient(135deg, #eef4ff, #ffffff); border: 1px solid #c8d8ff; }#cd-absolute-value-equation-solver .cd-abs-result-title { font-size: 13px; color: var(–cd-muted); font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 6px; }#cd-absolute-value-equation-solver .cd-abs-main-result { font-size: clamp(24px, 4vw, 38px); color: var(–cd-primary-dark); font-weight: 900; line-height: 1.15; margin-bottom: 8px; overflow-wrap: anywhere; }#cd-absolute-value-equation-solver .cd-abs-steps { margin-top: 12px; padding-left: 18px; color: var(–cd-text); }#cd-absolute-value-equation-solver .cd-abs-error { display: none; margin-top: 12px; padding: 12px 14px; border-radius: 10px; background: #fff1f0; color: var(–cd-error); border: 1px solid #ffd3cf; font-weight: 700; }#cd-absolute-value-equation-solver .cd-abs-copy-status { min-height: 22px; font-size: 13px; color: var(–cd-success); margin-top: 8px; font-weight: 700; }#cd-absolute-value-equation-solver .cd-abs-section { background: var(–cd-card); border: 1px solid var(–cd-border); border-radius: 12px; padding: 20px; margin-top: 16px; }#cd-absolute-value-equation-solver .cd-abs-section ul, #cd-absolute-value-equation-solver .cd-abs-section ol { margin: 10px 0 0; padding-left: 22px; color: var(–cd-muted); }#cd-absolute-value-equation-solver .cd-abs-section li { margin-bottom: 8px; }#cd-absolute-value-equation-solver .cd-abs-formula { background: #f8fafc; border: 1px solid var(–cd-border); border-radius: 10px; padding: 14px; color: var(–cd-text); font-weight: 700; overflow-wrap: anywhere; margin: 12px 0; }#cd-absolute-value-equation-solver .cd-abs-table-wrap { overflow-x: auto; margin-top: 12px; }#cd-absolute-value-equation-solver table { width: 100%; border-collapse: collapse; min-width: 520px; }#cd-absolute-value-equation-solver th, #cd-absolute-value-equation-solver td { border: 1px solid var(–cd-border); padding: 10px; text-align: left; vertical-align: top; }#cd-absolute-value-equation-solver th { background: #f8fafc; color: var(–cd-text); }#cd-absolute-value-equation-solver details { border: 1px solid var(–cd-border); border-radius: 10px; padding: 12px 14px; margin-top: 10px; background: #ffffff; }#cd-absolute-value-equation-solver summary { cursor: pointer; font-weight: 800; color: var(–cd-text); }#cd-absolute-value-equation-solver details p { margin-top: 10px; margin-bottom: 0; }#cd-absolute-value-equation-solver .cd-abs-related { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }#cd-absolute-value-equation-solver .cd-abs-related a { display: inline-flex; padding: 9px 12px; border-radius: 999px; background: #f8fafc; border: 1px solid var(–cd-border); color: var(–cd-primary-dark); text-decoration: none; font-weight: 700; }@media (max-width: 860px) { #cd-absolute-value-equation-solver { padding: 14px; }#cd-absolute-value-equation-solver .cd-abs-tool { padding: 18px; }#cd-absolute-value-equation-solver .cd-abs-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }@media (max-width: 560px) { #cd-absolute-value-equation-solver .cd-abs-grid { grid-template-columns: 1fr; }#cd-absolute-value-equation-solver .cd-abs-actions button { width: 100%; }#cd-absolute-value-equation-solver .cd-abs-equation-preview { font-size: 16px; } }
Algebra

Absolute Value Equation Solver

Use this absolute value equation solver to solve equations in the form |ax + b| + d = e and see the step-by-step split into two linear equations.

|2x – 3| + 0 = 5
In ax + b. Use decimals or fractions.
Inside the absolute value.
Added after the absolute value.
The value after the equals sign.
0 1 2 3 4 6
Result
x = -1, 4
The equation has two real solutions because the absolute value equals a positive number.
  1. Move the outside value: |2x – 3| = 5.
  2. Split into two equations: 2x – 3 = 5 and 2x – 3 = -5.
  3. Solve both equations to get x = 4 and x = -1.

Quick Result Explanation

The solver first isolates the absolute value part. If the isolated value is positive, the equation usually has two solutions. If it is zero, it has one solution. If it is negative, there is no real solution because an absolute value cannot be negative.

Formula and Method

This calculator solves absolute value equations written as:

|ax + b| + d = e

First subtract the outside value from both sides:

|ax + b| = e – d

Let r = e – d. Then:

  • If r < 0, there is no real solution.
  • If r = 0, solve ax + b = 0.
  • If r > 0, solve both ax + b = r and ax + b = -r.

How to Use the Absolute Value Equation Solver

  1. Enter the coefficient of x as a.
  2. Enter the constant inside the absolute value as b.
  3. Enter any value added outside the absolute value as d. Use 0 if there is none.
  4. Enter the right side of the equation as e.
  5. Choose how many decimal places you want in the answer.
  6. Click Solve Equation to get the real solution set and steps.

Worked Example

Suppose the equation is:

|2x – 3| = 5

Here, a = 2, b = -3, d = 0, and e = 5.

  1. Isolate the absolute value: |2x – 3| = 5.
  2. Split it into two equations: 2x – 3 = 5 and 2x – 3 = -5.
  3. Solve the first equation: 2x = 8, so x = 4.
  4. Solve the second equation: 2x = -2, so x = -1.
  5. The solution set is {-1, 4}.

Common Use Cases

Use caseWhy absolute value matters
Algebra homeworkStudents can check whether an equation has two, one, or no real solutions.
Distance from a target valueAbsolute value measures distance without caring about direction.
Test preparationThe tool shows the split into positive and negative cases, which is a common exam step.
Step-by-step checkingIt helps spot sign errors when moving from absolute value form to linear equations.

Common Mistakes

  • Forgetting the negative case: |A| = r means A = r or A = -r when r is positive.
  • Splitting too early: Isolate the absolute value before creating two equations.
  • Accepting a negative absolute value: If the isolated right side is negative, there is no real solution.
  • Ignoring a = 0: If x disappears from the equation, the result may be all real numbers or no solution.
  • Rounding too soon: Keep exact values as long as possible, then round the final answer if needed.

Limitations

This calculator is designed for one-variable linear absolute value equations in the form |ax + b| + d = e. It does not solve equations with multiple absolute value expressions, quadratic expressions inside the absolute value, inequalities, or systems of equations.

Related Calculators

These tools can help with nearby algebra and arithmetic tasks:

FAQ

How do you solve an absolute value equation?

First isolate the absolute value expression. Then split the equation into two cases: the inside expression equals the positive right side and the inside expression equals the negative right side.

Why can an absolute value equation have two answers?

Absolute value represents distance from zero. For example, both 5 and -5 have an absolute value of 5, so many absolute value equations create two possible linear equations.

When does an absolute value equation have no real solution?

It has no real solution when the isolated absolute value is equal to a negative number, such as |x + 2| = -3.

Can this solver handle fractions?

Yes. You can enter values such as 1/2, -3/4, or 2.5 in the input fields.

What equation format does this calculator use?

It solves equations in the format |ax + b| + d = e. Use d = 0 for a simpler equation such as |ax + b| = e.

(function() { function cdAbsReady(fn) { if (document.readyState === “loading”) { document.addEventListener(“DOMContentLoaded”, fn); } else { fn(); } }cdAbsReady(function() { var root = document.getElementById(“cd-absolute-value-equation-solver”); if (!root) { return; }var inputA = root.querySelector(“#cdAbsA”); var inputB = root.querySelector(“#cdAbsB”); var inputD = root.querySelector(“#cdAbsD”); var inputE = root.querySelector(“#cdAbsE”); var decimalsInput = root.querySelector(“#cdAbsDecimals”); var calculateButton = root.querySelector(“#cdAbsCalculate”); var copyButton = root.querySelector(“#cdAbsCopy”); var clearButton = root.querySelector(“#cdAbsClear”); var errorBox = root.querySelector(“#cdAbsError”); var preview = root.querySelector(“#cdAbsEquationPreview”); var mainResult = root.querySelector(“#cdAbsMainResult”); var summary = root.querySelector(“#cdAbsSummary”); var steps = root.querySelector(“#cdAbsSteps”); var copyStatus = root.querySelector(“#cdAbsCopyStatus”); var presetButtons = root.querySelectorAll(“.cd-abs-preset”); var lastCopyText = “”;function parseNumber(text) { var raw = String(text).trim(); var result = { ok: false, value: 0, message: “” };if (raw === “”) { result.message = “Please fill in every field.”; return result; }if (raw.indexOf(“/”) !== -1) { var parts = raw.split(“/”); if (parts.length !== 2) { result.message = “Fractions must use the format numerator/denominator.”; return result; }var top = Number(parts[0].trim()); var bottom = Number(parts[1].trim());if (!Number.isFinite(top)) { result.message = “Please enter valid numbers or simple fractions.”; return result; }if (!Number.isFinite(bottom)) { result.message = “Please enter valid numbers or simple fractions.”; return result; }if (bottom === 0) { result.message = “A fraction denominator cannot be zero.”; return result; }result.ok = true; result.value = top / bottom; return result; }var numericValue = Number(raw); if (!Number.isFinite(numericValue)) { result.message = “Please enter valid numbers. You may use decimals or simple fractions.”; return result; }result.ok = true; result.value = numericValue; return result; }function formatNumber(value, places) { if (Math.abs(value) 0) { expression = expression + ” + ” + formatNumber(b, 6); } else { if (b 0) { text = text + ” + ” + formatNumber(d, 6); } else { if (d < 0) { text = text + " – " + formatNumber(Math.abs(d), 6); } }text = text + " = " + formatNumber(e, 6); return text; }function showError(message) { errorBox.textContent = message; errorBox.style.display = "block"; }function hideError() { errorBox.textContent = ""; errorBox.style.display = "none"; }function setSteps(items) { steps.innerHTML = ""; items.forEach(function(item) { var li = document.createElement("li"); li.textContent = item; steps.appendChild(li); }); }function solveEquation() { try { hideError(); copyStatus.textContent = "";var parsedA = parseNumber(inputA.value); var parsedB = parseNumber(inputB.value); var parsedD = parseNumber(inputD.value); var parsedE = parseNumber(inputE.value); var allParsed = [parsedA.ok, parsedB.ok, parsedD.ok, parsedE.ok].every(Boolean);if (!allParsed) { var message = "Please check the equation inputs."; if (parsedA.message !== "") { message = parsedA.message; } else { if (parsedB.message !== "") { message = parsedB.message; } else { if (parsedD.message !== "") { message = parsedD.message; } else { if (parsedE.message !== "") { message = parsedE.message; } } } }showError(message); return; }var a = parsedA.value; var b = parsedB.value; var d = parsedD.value; var e = parsedE.value; var places = Number(decimalsInput.value); var r = e – d; var equationText = formatEquation(a, b, d, e); var insideText = formatLinearExpression(a, b); preview.textContent = equationText;if (a === 0) { var constantValue = Math.abs(b) + d; if (Math.abs(constantValue – e) < 1e-12) { mainResult.textContent = "All real numbers"; summary.textContent = "The x term disappears, and the remaining statement is true for every real value of x."; setSteps([ "Because a = 0, the expression inside the absolute value is constant: |" + formatNumber(b, places) + "|.", "Evaluate the left side: |" + formatNumber(b, places) + "| + " + formatNumber(d, places) + " = " + formatNumber(constantValue, places) + ".", "This equals the right side, so every real x is a solution." ]); lastCopyText = "All real numbers solve " + equationText; } else { mainResult.textContent = "No real solution"; summary.textContent = "The x term disappears, and the remaining statement is false."; setSteps([ "Because a = 0, the expression inside the absolute value is constant: |" + formatNumber(b, places) + "|.", "Evaluate the left side: |" + formatNumber(b, places) + "| + " + formatNumber(d, places) + " = " + formatNumber(constantValue, places) + ".", "This does not equal the right side, so there is no real solution." ]); lastCopyText = "No real solution for " + equationText; }return; }if (r < 0) { mainResult.textContent = "No real solution"; summary.textContent = "After isolating the absolute value, the equation asks an absolute value to equal a negative number."; setSteps([ "Move the outside value: |" + insideText + "| = " + formatNumber(r, places) + ".", "An absolute value cannot be negative.", "Therefore, the equation has no real solution." ]); lastCopyText = "No real solution for " + equationText; return; }if (Math.abs(r) < 1e-12) { var single = -b / a; mainResult.textContent = "x = " + formatNumber(single, places); summary.textContent = "The isolated absolute value equals zero, so the inside expression must be exactly zero."; setSteps([ "Move the outside value: |" + insideText + "| = 0.", "Set the inside expression equal to zero: " + insideText + " = 0.", "Solve for x: x = " + formatNumber(single, places) + "." ]); lastCopyText = "x = " + formatNumber(single, places) + " for " + equationText; return; }var xPositive = (r – b) / a; var xNegative = (-r – b) / a; var first = xPositive; var second = xNegative;if (second < first) { first = xNegative; second = xPositive; }mainResult.textContent = "x = " + formatNumber(first, places) + ", " + formatNumber(second, places); summary.textContent = "The equation has two real solutions because the isolated absolute value equals a positive number."; setSteps([ "Move the outside value: |" + insideText + "| = " + formatNumber(r, places) + ".", "Split into two equations: " + insideText + " = " + formatNumber(r, places) + " and " + insideText + " = -" + formatNumber(r, places) + ".", "Solve the positive case: x = " + formatNumber(xPositive, places) + ".", "Solve the negative case: x = " + formatNumber(xNegative, places) + ".", "The solution set is {" + formatNumber(first, places) + ", " + formatNumber(second, places) + "}." ]); lastCopyText = "x = " + formatNumber(first, places) + ", " + formatNumber(second, places) + " for " + equationText; } catch (err) { showError("The calculator could not process the equation. Please check the inputs and try again."); } }function updatePreviewOnly() { var parsedA = parseNumber(inputA.value); var parsedB = parseNumber(inputB.value); var parsedD = parseNumber(inputD.value); var parsedE = parseNumber(inputE.value); var allParsed = [parsedA.ok, parsedB.ok, parsedD.ok, parsedE.ok].every(Boolean);if (allParsed) { preview.textContent = formatEquation(parsedA.value, parsedB.value, parsedD.value, parsedE.value); } }function copyResult() { copyStatus.textContent = "";if (lastCopyText === "") { solveEquation(); }if (lastCopyText === "") { copyStatus.textContent = "Solve the equation first."; return; }if (navigator.clipboard) { navigator.clipboard.writeText(lastCopyText).then(function() { copyStatus.textContent = "Result copied."; }).catch(function() { copyStatus.textContent = "Copy failed. You can select the result manually."; }); } else { copyStatus.textContent = "Copy is not available in this browser."; } }function clearTool() { inputA.value = ""; inputB.value = ""; inputD.value = ""; inputE.value = ""; decimalsInput.value = "2"; preview.textContent = "|ax + b| + d = e"; mainResult.textContent = "Enter an equation"; summary.textContent = "Fill in the values above, then click Solve Equation."; setSteps(["Your step-by-step solution will appear here."]); lastCopyText = ""; copyStatus.textContent = ""; hideError(); }calculateButton.addEventListener("click", solveEquation); copyButton.addEventListener("click", copyResult); clearButton.addEventListener("click", clearTool);[inputA, inputB, inputD, inputE, decimalsInput].forEach(function(item) { item.addEventListener("input", updatePreviewOnly); item.addEventListener("change", updatePreviewOnly); });presetButtons.forEach(function(button) { button.addEventListener("click", function() { inputA.value = button.getAttribute("data-a"); inputB.value = button.getAttribute("data-b"); inputD.value = button.getAttribute("data-d"); inputE.value = button.getAttribute("data-e"); solveEquation(); }); });solveEquation(); }); })();

Similar Calculations