MyInternships.in

Free online graphing tool

Straight Line Graph Calculator (y = mx + c)

Every linear equation draws a straight line. In slope–intercept form y = mx + c the number m is the gradient — how far the line rises for each step to the right — and c is where it crosses the y-axis.

Use the sliders below to change m and c and watch the line tilt and shift. It is the quickest way to build an intuition for what "slope" and "intercept" actually look like.

Key points of y = m x + c inside the visible window (-10 ≤ x ≤ 10). Pan or zoom to search a different range.

Roots (x-intercepts)

  • x = -2

y-intercept

  • y = 2

Turning points

No maximum or minimum here

Intersections

No crossing with another curve

Enter a value of x

What is a straight line graph calculator?

A straight line graph calculator plots linear equations of the form y = mx + c. The gradient m is the change in y divided by the change in x, and c is the y-intercept. A positive m slopes upward from left to right, a negative m slopes downward, and m = 0 gives a horizontal line.

Key facts at a glance

Slope–intercept formy = mx + c
Gradientm = (y₂ − y₁) / (x₂ − x₁) — rise over run
y-intercept(0, c)
x-interceptx = −c / m (when m ≠ 0)
Horizontal liney = k, gradient 0
Vertical linex = k — type it exactly like that; it has no gradient
Parallel linesSame m, different c
Perpendicular linesGradients multiply to −1, so m₂ = −1/m₁

How to plot straight line graphs — step by step

  1. 1

    Type the equation

    Enter y = 2x + 3. You can also paste the point-slope or standard form rearranged into y = … form.

  2. 2

    Read the intercepts

    The Key points tab gives the y-intercept directly and lists the root, which is the x-intercept of the line.

  3. 3

    Add a second line

    Type another equation to compare. Two lines with the same gradient never meet; otherwise the Key points tab shows exactly where they cross.

  4. 4

    Check a vertical line

    Type x = 4 to draw a vertical line. It is not a function of x, which is why it needs the x = … form.

Straight line examples you can plot right now

Copy any equation into the calculator above, or open it in the full calculator with one click.

Positive gradient

y = 2x + 3

Rises 2 units for every 1 to the right, crossing the y-axis at 3.

Plot this →

Negative gradient

y = -0.5x + 4

Falls as x increases; crosses the x-axis at x = 8.

Plot this →

Through the origin

y = 3x

c = 0, so the line passes through (0, 0). This is direct proportion.

Plot this →

Horizontal and vertical

y = 5

A flat line. Pair it with x = -2 to see the vertical case.

Plot this →

Perpendicular pair

y = 2x

Add y = -0.5x and use the Equal-scale button — the two lines meet at a right angle.

Plot this →

Understanding the straight line graph

Gradient as a rate
Outside the maths class the gradient is a rate of change: rupees per hour, kilometres per litre, marks per hour of study. The steeper the line, the faster the quantity changes.
Why vertical lines have no gradient
The run between two points on a vertical line is zero, and dividing by zero is undefined — which is also why a vertical line cannot be written as y = mx + c.
Solving simultaneous equations
Two linear equations plotted together meet at exactly one point unless they are parallel. The coordinates of that intersection are the solution of the pair.

Straight line graph — frequently asked questions

How do I graph y = mx + c?

Type the equation into the calculator above, for example y = 2x + 3. The line appears instantly. To explore, use letters instead of numbers — y = m x + c gives you a slider for each.

How do I find the gradient from a graph?

Pick any two points on the line, then divide the change in y by the change in x. Hover over the line at two places to read the exact coordinates from the trace readout.

How do I plot a vertical line?

Type x = 4. A vertical line cannot be written in y = form because it fails the vertical line test, so this calculator accepts x = … equations for exactly this reason.

How do I check if two lines are parallel or perpendicular?

Plot both. Equal gradients mean parallel — the Key points tab will show no intersection. If the gradients multiply to −1 they are perpendicular; press the Equal-scale button so the right angle looks like a right angle on screen.

How do I solve two linear equations graphically?

Plot both lines and read the intersection. Its x and y coordinates are the solution of the simultaneous pair, and the Key points tab prints them for you.

What does the y-intercept represent?

It is the value of y when x = 0 — the starting value before any change. In a cost equation it is the fixed cost, and in a distance equation it is the head start.

Every graph type

Hiring engineering or analytics talent in India?

MyInternships.in connects 1,20,000+ students and freshers — from IITs, NITs, IIITs and every major engineering and commerce college in India — with 5,000+ companies. Post an internship or fresher role in minutes, screen candidates by skill, campus and graduation year, and hire without any commission.

Free to use, no signup. Part of the MyInternships.in free tools for students.