# Slope calculator > How steep is the line through two points? Slope, equation, distance, midpoint and angle of the line through two points. Find the slope of the line through two points as rise over run, with its equation y = mx + b, the distance, the midpoint and the angle, drawn live. - Page: https://how.box/slope/ - Runs entirely in the browser. - License: HowToolbox's own text and data (titles, explanations, FAQs, tool descriptions and schemas, this file) are CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/); AI training and answers are welcome. Attribute "HowToolbox (how.box)" with a link to the page used. Third-party data keeps its own terms; the name and logo are not licensed. Publisher: HowToolbox, contact@how.box. Terms: https://how.box/about/terms/ ## Inputs Answer link: https://how.box/slope/?x1={x1}&y1={y1}&x2={x2}&y2={y2} - `x1` (number -1e6 to 1e6): x of point A. Example: `1`. - `y1` (number -1e6 to 1e6): y of point A. Example: `2`. - `x2` (number -1e6 to 1e6): x of point B. Example: `5`. - `y2` (number -1e6 to 1e6): y of point B. Example: `5`. Example answer: https://how.box/slope/?x1=1&y1=2&x2=5&y2=5 A complete link carries the primary answer in the page HTML; a missing or invalid value shows the default page. ## Agent tools - `slope_calculate`: The line through A(x1, y1) and B(x2, y2), coordinates −1000000 to 1000000. - MCP, one POST to https://how.box/mcp: `{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"slope_calculate","arguments":{"x1":1,"y1":2,"x2":5,"y2":5}}}` - GET: https://how.box/mcp/run/slope_calculate?x1=1&y1=2&x2=5&y2=5 ## How it works The slope tells how steep a straight line is: how much it goes up (the rise) for each step to the right (the run). A slope of 2 climbs two units for every one across, a negative slope goes downhill, 0 is flat, and a vertical line has no slope at all because its run is zero. Through A(x₁, y₁) and B(x₂, y₂) the slope is m = (y₂ − y₁) / (x₂ − x₁). The line is then y = mx + b, where the y-intercept b = y₁ − m·x₁ is where it crosses the y-axis. From (1, 2) to (5, 5) the rise is 3 and the run 4, so m = 3/4 = 0.75 and y = 0.75x + 1.25. The rise and run are the two legs of a right triangle, so the distance between the points is √(run² + rise²) by Pythagoras: 5 in the example. The midpoint averages the coordinates, and the angle to the x-axis is the arctangent of the slope (36.87°). Results are rounded to six significant digits. Source: OpenStax College Algebra 2e, sections 2.1 and 4.1. ## FAQ **Can I enter decimal or negative coordinates?** Yes. Each coordinate can be a decimal or a negative number within the input limits. A reduced fraction is shown when the rise and run are whole numbers. **Does it matter which point is A?** No. Swapping the points changes the sign of both the rise and the run, so their ratio, the slope, stays the same, and so do the distance and the midpoint. **How do I turn a slope into a percentage grade?** Multiply it by 100. A slope of 0.08 is an 8 % grade: the road climbs 8 m for every 100 m across. **How can I check whether two lines are perpendicular?** For two non-vertical lines, their slopes multiply to −1. A horizontal line and a vertical line are also perpendicular, although the vertical line has no numerical slope. **What happens if I enter the same point twice?** One point does not determine a unique line. The distance is zero and the midpoint is that point, but there is no unique slope or line equation. More: [HowToolbox index](https://how.box/llms.txt) · [Agent Skill](https://how.box/skill.md) · [agent terms](https://how.box/about/agents/)