{
    "name": "Slope Calculator",
    "url": "https://calculators.geekmidst.com/calculators/slope-calculator",
    "markdown": "https://calculators.geekmidst.com/calculators/slope-calculator.md",
    "category": "Algebra, geometry & advanced math",
    "description": "Find the slope between two points as a decimal and a fraction, the line’s equation y = mx + b, its angle, the distance and the midpoint.",
    "summary": "Slope is rise over run: how much y changes for each step in x. Enter two points to get the slope and the equation of the line through them.",
    "also_called": [
        "Gradient calculator",
        "Rise over run calculator"
    ],
    "applies_to": "Worldwide",
    "last_updated": "2026-10-29",
    "computation": "Results are computed in the visitor’s browser on the HTML page. This API describes the calculator; it does not compute results.",
    "inputs": [
        {
            "name": "x1",
            "label": "x₁",
            "type": "number",
            "default": "1"
        },
        {
            "name": "y1",
            "label": "y₁",
            "type": "number",
            "default": "2"
        },
        {
            "name": "x2",
            "label": "x₂",
            "type": "number",
            "default": "5"
        },
        {
            "name": "y2",
            "label": "y₂",
            "type": "number",
            "default": "5"
        }
    ],
    "outputs": [
        {
            "key": "slope",
            "label": "Slope (m)",
            "format": "text"
        },
        {
            "key": "fraction",
            "label": "Slope as a fraction",
            "format": "text"
        },
        {
            "key": "equation",
            "label": "Equation of the line",
            "format": "text"
        },
        {
            "key": "intercept",
            "label": "y-intercept (b)",
            "format": "text"
        },
        {
            "key": "angle",
            "label": "Angle to the x-axis",
            "format": "number"
        },
        {
            "key": "rise",
            "label": "Rise (Δy)",
            "format": "number"
        },
        {
            "key": "run",
            "label": "Run (Δx)",
            "format": "number"
        },
        {
            "key": "distance",
            "label": "Distance between the points",
            "format": "number"
        },
        {
            "key": "midpoint",
            "label": "Midpoint",
            "format": "text"
        }
    ],
    "formula": {
        "text": "m = (y₂ − y₁) ÷ (x₂ − x₁);  b = y₁ − m·x₁;  θ = arctan m;  d = √((x₂ − x₁)² + (y₂ − y₁)²)",
        "variables": {
            "(x₁, y₁), (x₂, y₂)": "the two points",
            "m": "slope",
            "b": "where the line crosses the y-axis",
            "θ": "angle of the line above the x-axis"
        }
    },
    "worked_example": {
        "inputs": {
            "x1": "1",
            "y1": "2",
            "x2": "5",
            "y2": "5"
        },
        "steps": [
            "Rise = 5 − 2 = 3; run = 5 − 1 = 4; m = 3 ÷ 4 = 0.75.",
            "b = 2 − 0.75 × 1 = 1.25, so y = 0.75x + 1.25.",
            "Distance = √(4² + 3²) = √25 = 5."
        ],
        "result": "The line through (1, 2) and (5, 5) has slope 3/4 and equation y = 0.75x + 1.25."
    },
    "interpretation": "A positive slope rises from left to right, a negative one falls. A slope of 0.75 means y goes up 3 for every 4 across, or 75% as a road or ramp grade.",
    "assumptions": [
        "Points are on a flat x–y plane with the same scale on both axes (the angle depends on this)."
    ],
    "limitations": [
        "A vertical line (x₁ = x₂) has no defined slope; the calculator gives its equation as x = constant."
    ],
    "rules": null,
    "faqs": [
        {
            "question": "What is the difference between slope and grade?",
            "answer": "Grade is slope written as a percentage: a slope of 0.05 is a 5% grade, rising 5 m over 100 m horizontally."
        },
        {
            "question": "Do parallel and perpendicular lines have related slopes?",
            "answer": "Parallel lines have equal slopes. Perpendicular lines have slopes that multiply to −1, such as 2 and −½."
        }
    ],
    "sources": [],
    "related": [
        {
            "name": "Quadratic Formula Calculator",
            "url": "https://calculators.geekmidst.com/calculators/quadratic-formula-calculator"
        },
        {
            "name": "Triangle Calculator",
            "url": "https://calculators.geekmidst.com/calculators/triangle-calculator"
        },
        {
            "name": "Percentage Calculator",
            "url": "https://calculators.geekmidst.com/calculators/percentage-calculator"
        }
    ],
    "disclaimer": null,
    "publisher": "GM¹X CalcVerse"
}