Definition
What a number line shows
A number line places real numbers along a straight axis with a consistent scale. Points farther to the right have greater values on the usual left-to-right axis. An interval on that line represents all values between its bounds, with endpoint markers showing which bounds are included.
- Moving right
- Values increase
- Open endpoint
- The bound is excluded
- Filled endpoint
- The bound is included
How to use the number line generator
Choose where the line starts and ends and how far apart the tick marks are. The start must be smaller than the end, and the step can be a whole number, a decimal such as 0.5 or a fraction such as 1/3. Pick decimal or fraction labels for the ticks. If the range and step would create too many ticks to read, only some are labelled, and you get a note saying so.
To mark points, list them separated by commas. Each point is labelled with exactly what you typed, so 3/4 shows as 3/4 rather than 0.75. To show the solution of an inequality, type it in the inequality box and the matching part of the line is shaded. Change the color to make the points and shading stand out, or use black for printing.
Worked example: graphing −2 < x ≤ 3
The example loaded in the generator runs from −5 to 5 in steps of 1 and shades −2 < x ≤ 3. That means every number greater than −2 and less than or equal to 3. The circle at −2 is open, because −2 itself is not included. The circle at 3 is filled, because 3 is included. The line between them is shaded.
In interval notation this is (−2, 3]. The integers that satisfy it are −1, 0, 1, 2 and 3, which is five integers. A number such as 2.5 is also a solution, since the shading covers every number in between, not only the tick marks. If the inequality were x > −2 instead, the shading would run from −2 off the right-hand end of the line with an arrow, written (−2, ∞).
Placing fractions and decimals
To place a fraction by hand, divide each whole-number gap into as many equal parts as the denominator, then count up the numerator. For 3/4, split the gap from 0 to 1 into four parts and count three. A mixed number such as 2 1/2 sits halfway between 2 and 3. For negative values, count the same way to the left of zero: −1/2 is halfway between −1 and 0.
To compare fractions with different denominators, mark them on one line. For example, 2/3 sits just to the right of 5/8, because 2/3 ≈ 0.667 and 5/8 = 0.625. Use the decimal to fraction calculator if you need to turn a decimal point into a fraction first.
Ideas for classwork
Number lines help with adding and subtracting integers: start at the first number and jump right to add or left to subtract. With a step of 1/4 or 1/8 they can show equivalent fractions, and with a step of 0.1 they help with rounding decimals. Print a blank line with only the ticks and labels for students to mark their own answers.
For inequalities in two variables, or for graphing equations such as y = 2x + 1, use the graphing calculator, which draws on a coordinate grid instead of a single line.
Step-by-step example
Shade −2 < x ≤ 3 on an axis from −5 to 5 with unit ticks.
| Step | Result |
|---|---|
| Interval notation | (−2, 3] |
| Left endpoint | −2 (open) |
| Right endpoint | 3 (filled) |
| Integers in the interval | −1, 0, 1, 2, 3 |
Formulas used
Position of a fraction a/b = a ÷ b
Mixed number w n/d = w + n ÷ d (or −(w + n ÷ d) when negative)
Open circle: < or >; filled circle: ≤ or ≥
- a
- fraction numerator
- b
- fraction denominator
- w
- whole part of a mixed number
- n
- mixed number’s fractional numerator
- d
- mixed number’s fractional denominator
Example: 2 1/2 = 2 + 1 ÷ 2 = 2.5, halfway between 2 and 3. −2 < x ≤ 3 has an open circle at −2 and a filled one at 3, written (−2, 3], and contains the integers −1, 0, 1, 2 and 3.
When the answer can mislead
- A finite viewport can cut off part of an interval that continues indefinitely.
- If the tick spacing changes, use the labels to judge distance and read the same solution set.
- Two ranges that meet at an excluded point can leave a single-value gap.
Questions
How do I make a number line?
Type the number to start at, the number to end at and the step between tick marks. The number line draws straight away. Add points to mark, separated by commas, and an inequality to shade if you need one. Then download it as a PNG or SVG, or print it, for a worksheet or homework.
Can I make a number line with fractions?
Yes. Type a fraction as the step, such as 1/4, and set the tick labels to fractions. The ticks are then labelled 0, 1/4, 1/2, 3/4, 1 and so on, in lowest terms. You can also mark points written as fractions or mixed numbers, such as 3/8 or 2 1/2, and each one is placed exactly.
How do I graph an inequality on a number line?
Type the inequality in the inequality box, such as x > 3, x <= -1 or -2 < x <= 3. The solution is shaded. An open circle marks an end that is not included (< or >) and a filled circle marks one that is (≤ or ≥). An arrow shows the shading carries on past the end of the line. You can also type two parts joined by or, such as x < -1 or x >= 2.
How do I type ≤ and ≥?
Type <= for “less than or equal to” and >= for “greater than or equal to”. The symbols ≤ and ≥ also work if you paste them in. You can write the inequality either way round, so 3 > x means the same as x < 3.
What is interval notation?
It is a short way to write a range of numbers. A square bracket means the end is included and a round bracket means it is not. −2 < x ≤ 3 is written (−2, 3]. x ≥ 4 is [4, ∞), where ∞ always takes a round bracket because the range never ends. The generator shows the interval notation for the inequality you type.
Can I show negative numbers?
Yes. Start the line at any negative number, such as −10, and end it at any number larger than the start. Negative fractions and decimals work as points too, for example −1/2 or −2.75.
Embed this calculator
Cite this calculator
Number Line Generator. CalculatorLab. https://calculatorlab.site/calculators/number-line-generator/. Last updated . Accessed .