{
  "id": "x-intercept",
  "version": "3e42326313ff",
  "status": "published",
  "name": "X-Intercept Calculator",
  "question": "What is the x-intercept of my graph?",
  "summary": "Finds the x-intercept (and the y-intercept) of a line in slope-intercept form, through two points, or in standard form, or of a parabola y = ax² + bx + c.",
  "category": "math",
  "subcategory": "algebra",
  "url": "https://www.acalculator.org/math/x-intercept-calculator",
  "markdown": "https://www.acalculator.org/math/x-intercept-calculator.md",
  "kind": "function",
  "method": "Set y = 0 and solve for x: y = mx + b gives x = −b ÷ m; Ax + By = C gives x = C ÷ A; two points give m = (y₂ − y₁) ÷ (x₂ − x₁) first; y = ax² + bx + c gives x = (−b ± √(b² − 4ac)) ÷ 2a.",
  "assumptions": [
    "Coefficients are read as the exact decimals typed; line intercepts are exact fractions.",
    "A parabola’s irrational x-intercepts are 64-bit floats, shown to 10 significant figures in the points.",
    "With a = 0, y = ax² + bx + c is the line y = bx + c."
  ],
  "inputs": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "form": {
        "title": "Equation",
        "description": "How the graph is given: y = mx + b, two points on a line, Ax + By = C, or y = ax² + bx + c.",
        "type": "string",
        "enum": [
          "slope",
          "points",
          "standard",
          "quadratic"
        ]
      },
      "m": {
        "title": "Slope (m)",
        "description": "The slope of the line y = mx + b.",
        "type": "number",
        "minimum": -1000000000,
        "maximum": 1000000000
      },
      "b": {
        "title": "y-intercept (b)",
        "description": "The constant b of y = mx + b.",
        "type": "number",
        "minimum": -1000000000,
        "maximum": 1000000000
      },
      "x1": {
        "title": "x₁",
        "description": "The x-coordinate of the first point.",
        "type": "number",
        "minimum": -1000000000,
        "maximum": 1000000000
      },
      "y1": {
        "title": "y₁",
        "description": "The y-coordinate of the first point.",
        "type": "number",
        "minimum": -1000000000,
        "maximum": 1000000000
      },
      "x2": {
        "title": "x₂",
        "description": "The x-coordinate of the second point.",
        "type": "number",
        "minimum": -1000000000,
        "maximum": 1000000000
      },
      "y2": {
        "title": "y₂",
        "description": "The y-coordinate of the second point.",
        "type": "number",
        "minimum": -1000000000,
        "maximum": 1000000000
      },
      "A": {
        "title": "A",
        "description": "The coefficient of x in Ax + By = C.",
        "type": "number",
        "minimum": -1000000000,
        "maximum": 1000000000
      },
      "B": {
        "title": "B",
        "description": "The coefficient of y in Ax + By = C.",
        "type": "number",
        "minimum": -1000000000,
        "maximum": 1000000000
      },
      "C": {
        "title": "C",
        "description": "The constant on the right of Ax + By = C.",
        "type": "number",
        "minimum": -1000000000,
        "maximum": 1000000000
      },
      "qa": {
        "title": "a",
        "description": "The coefficient of x² in y = ax² + bx + c.",
        "type": "number",
        "minimum": -1000000000,
        "maximum": 1000000000
      },
      "qb": {
        "title": "b",
        "description": "The coefficient of x in y = ax² + bx + c.",
        "type": "number",
        "minimum": -1000000000,
        "maximum": 1000000000
      },
      "qc": {
        "title": "c",
        "description": "The constant c of y = ax² + bx + c.",
        "type": "number",
        "minimum": -1000000000,
        "maximum": 1000000000
      }
    }
  },
  "outputs": {
    "intercepts": {
      "label": "x-intercept",
      "description": "The points where the graph crosses the x-axis, as (x, 0), or None.",
      "format": "text"
    },
    "x1": {
      "label": "x-intercept x",
      "description": "The x value where the graph crosses the x-axis (the smaller one for a parabola).",
      "format": "number"
    },
    "x2": {
      "label": "Second x-intercept x",
      "description": "For a parabola with two x-intercepts, the larger x value.",
      "format": "number"
    },
    "yIntercept": {
      "label": "y-intercept",
      "description": "The point where the graph crosses the y-axis, as (0, y), or None.",
      "format": "text"
    },
    "equation": {
      "label": "Equation",
      "description": "The line as y = mx + b (or x = c for a vertical line), or the parabola as typed.",
      "format": "text"
    },
    "discriminant": {
      "label": "Discriminant (b² − 4ac)",
      "description": "For a parabola: above 0 gives two x-intercepts, 0 gives one, below 0 gives none.",
      "format": "number"
    }
  },
  "defaultAnswer": {
    "inputs": {
      "form": "slope",
      "m": 2,
      "b": -8,
      "x1": 1,
      "y1": -2,
      "x2": 4,
      "y2": 4,
      "A": 3,
      "B": 4,
      "C": 12,
      "qa": 1,
      "qb": -2,
      "qc": -3
    },
    "outputs": {
      "intercepts": "(4, 0)",
      "x1": 4,
      "yIntercept": "(0, -8)",
      "equation": "y = 2x - 8"
    },
    "text": "The x-intercept of y = 2x - 8 is (4, 0)."
  },
  "examples": [
    {
      "given": {
        "form": "slope",
        "m": 0.5,
        "b": -3
      },
      "expect": {
        "intercepts": "(6, 0)",
        "x1": 6,
        "yIntercept": "(0, -3)",
        "equation": "y = 1/2 x - 3"
      },
      "source": "OpenStax, Algebra and Trigonometry 2e, section 4.1 Linear Functions (x-intercept where f(x) = 0, y-intercept b), https://openstax.org/books/algebra-and-trigonometry-2e/pages/4-1-linear-functions, retrieved 2026-10-02, example: f(x) = ½x − 3 crosses the x-axis at (6, 0)"
    },
    {
      "given": {
        "form": "quadratic",
        "qa": 3,
        "qb": 5,
        "qc": -2
      },
      "expect": {
        "intercepts": "(-2, 0) and (1/3, 0)",
        "x1": -2,
        "x2": 0.3333333333333333,
        "discriminant": 49
      },
      "source": "OpenStax, Algebra and Trigonometry 2e, section 5.1 Quadratic Functions (x-intercepts from the quadratic formula), https://openstax.org/books/algebra-and-trigonometry-2e/pages/5-1-quadratic-functions, retrieved 2026-10-02, example 7: 3x² + 5x − 2 = (3x − 1)(x + 2), x-intercepts (−2, 0) and (1/3, 0)"
    },
    {
      "given": {
        "form": "quadratic",
        "qa": 2,
        "qb": 4,
        "qc": -4
      },
      "expect": {
        "x1": -2.732050807568877,
        "x2": 0.7320508075688773,
        "intercepts": "(-2.732050808, 0) and (0.7320508076, 0)"
      },
      "source": "OpenStax, Algebra and Trigonometry 2e, section 5.1 Quadratic Functions (x-intercepts from the quadratic formula), https://openstax.org/books/algebra-and-trigonometry-2e/pages/5-1-quadratic-functions, retrieved 2026-10-02, example 8: 2x² + 4x − 4 has x-intercepts −1 ± √3, about (−2.732, 0) and (0.732, 0)"
    },
    {
      "given": {
        "form": "slope",
        "m": 2,
        "b": -8
      },
      "expect": {
        "intercepts": "(4, 0)",
        "x1": 4,
        "yIntercept": "(0, -8)",
        "equation": "y = 2x - 8"
      },
      "source": "OpenStax, Algebra and Trigonometry 2e, section 4.1 Linear Functions (x-intercept where f(x) = 0, y-intercept b), https://openstax.org/books/algebra-and-trigonometry-2e/pages/4-1-linear-functions, retrieved 2026-10-02; hand calculation in content.mdx: 0 = 2x − 8, so x = 4"
    },
    {
      "given": {
        "form": "points",
        "x1": 1,
        "y1": -2,
        "x2": 4,
        "y2": 4
      },
      "expect": {
        "intercepts": "(2, 0)",
        "x1": 2,
        "yIntercept": "(0, -4)",
        "equation": "y = 2x - 4"
      },
      "source": "OpenStax, Algebra and Trigonometry 2e, section 4.1 Linear Functions (x-intercept where f(x) = 0, y-intercept b), https://openstax.org/books/algebra-and-trigonometry-2e/pages/4-1-linear-functions, retrieved 2026-10-02; hand calculation in content.mdx: m = (4 + 2) ÷ (4 − 1) = 2, b = −2 − 2 = −4, x = 4 ÷ 2 = 2"
    },
    {
      "given": {
        "form": "standard",
        "A": 3,
        "B": 4,
        "C": 12
      },
      "expect": {
        "intercepts": "(4, 0)",
        "yIntercept": "(0, 3)",
        "equation": "y = -3/4 x + 3"
      },
      "source": "OpenStax, Algebra and Trigonometry 2e, section 4.1 Linear Functions (x-intercept where f(x) = 0, y-intercept b), https://openstax.org/books/algebra-and-trigonometry-2e/pages/4-1-linear-functions, retrieved 2026-10-02; hand calculation in content.mdx: y = 0 gives 3x = 12, x = 4; x = 0 gives 4y = 12, y = 3"
    },
    {
      "given": {
        "form": "standard",
        "A": 3,
        "B": 0,
        "C": 8
      },
      "expect": {
        "intercepts": "(8/3, 0)",
        "x1": 2.6666666666666665,
        "yIntercept": "None: the line does not cross the y-axis",
        "equation": "x = 8/3"
      },
      "source": "hand calculation in content.mdx: 3x = 8 is the vertical line x = 8/3"
    },
    {
      "given": {
        "form": "quadratic",
        "qa": 1,
        "qb": -2,
        "qc": -3
      },
      "expect": {
        "intercepts": "(-1, 0) and (3, 0)",
        "x1": -1,
        "x2": 3,
        "discriminant": 16,
        "yIntercept": "(0, -3)",
        "equation": "y = x² - 2x - 3"
      },
      "source": "OpenStax, Algebra and Trigonometry 2e, section 5.1 Quadratic Functions (x-intercepts from the quadratic formula), https://openstax.org/books/algebra-and-trigonometry-2e/pages/5-1-quadratic-functions, retrieved 2026-10-02; hand calculation in content.mdx: x² − 2x − 3 = (x + 1)(x − 3)"
    },
    {
      "given": {
        "form": "quadratic",
        "qa": 1,
        "qb": 0,
        "qc": -2
      },
      "expect": {
        "intercepts": "(-1.414213562, 0) and (1.414213562, 0)",
        "x1": -1.4142135623730951,
        "x2": 1.4142135623730951,
        "discriminant": 8
      },
      "source": "OpenStax, Algebra and Trigonometry 2e, section 5.1 Quadratic Functions (x-intercepts from the quadratic formula), https://openstax.org/books/algebra-and-trigonometry-2e/pages/5-1-quadratic-functions, retrieved 2026-10-02; hand calculation in content.mdx: x² = 2, x = ±√2; Python 3: math.sqrt(2) = 1.4142135623730951"
    },
    {
      "given": {
        "form": "quadratic",
        "qa": 1,
        "qb": 2,
        "qc": 5
      },
      "expect": {
        "intercepts": "None: the graph does not cross the x-axis",
        "discriminant": -16
      },
      "source": "OpenStax, Algebra and Trigonometry 2e, section 5.1 Quadratic Functions (x-intercepts from the quadratic formula), https://openstax.org/books/algebra-and-trigonometry-2e/pages/5-1-quadratic-functions, retrieved 2026-10-02; hand calculation in content.mdx: b² − 4ac = 4 − 20 = −16 < 0"
    },
    {
      "given": {
        "form": "slope",
        "m": 0,
        "b": 5
      },
      "expect": {
        "intercepts": "None: the graph does not cross the x-axis",
        "yIntercept": "(0, 5)",
        "equation": "y = 5"
      },
      "source": "hand calculation in content.mdx: the horizontal line y = 5 never meets y = 0"
    }
  ],
  "sources": [
    "OpenStax, Algebra and Trigonometry 2e, section 4.1 Linear Functions (x-intercept where f(x) = 0; example f(x) = ½x − 3 gives (6, 0)), CC BY 4.0, retrieved 2026-10-02. https://openstax.org/books/algebra-and-trigonometry-2e/pages/4-1-linear-functions",
    "OpenStax, Algebra and Trigonometry 2e, section 5.1 Quadratic Functions (x-intercepts by factoring and by the quadratic formula; examples 3x² + 5x − 2 and 2x² + 4x − 4), CC BY 4.0, retrieved 2026-10-02. https://openstax.org/books/algebra-and-trigonometry-2e/pages/5-1-quadratic-functions"
  ],
  "related": [
    "quadratic-formula",
    "slope",
    "equation-solver"
  ],
  "changelog": []
}
