Number basics
Rational Numbers
A rational number is any number that can be written as a fraction p/q, where p and q are integers and q is not zero. That covers every integer, every ordinary fraction, and every decimal that either ends or repeats. This guide shows how to test a number, why rational decimals always end or repeat, how to turn a repeating decimal back into a fraction, and what makes a number irrational instead.
What makes a number rational
The word comes from ratio. A rational number is one that can be expressed as a ratio of two integers.
The key word is can. A number does not have to be written as a fraction to be rational; it only has to be possible to write it as one. The number 5 is rational because it equals 5/1. The decimal 0.75 is rational because it equals 3/4. The repeating decimal 0.333… is rational because it equals 1/3.
The condition q ≠ 0 is there because division by zero has no value. And p and q must be integers — a “fraction” such as √2/2 does not prove anything, because √2 is not an integer.
Examples of rational numbers
To show a number is rational, find a fraction of integers equal to it. If no such fraction can exist, the number is irrational.
| Number | As p/q | Rational? |
|---|---|---|
| 5 | 5/1 | Yes |
| −3 | −3/1 | Yes |
| 0 | 0/1 | Yes |
| 0.75 | 3/4 | Yes |
| −2.5 | −5/2 | Yes |
| 1 2/3 | 5/3 | Yes |
| 0.333… | 1/3 | Yes |
| 0.142857142857… | 1/7 | Yes |
| √9 | 3/1 | Yes |
| 22/7 | 22/7 | Yes |
| √2 ≈ 1.41421… | none exists | No |
| π ≈ 3.14159… | none exists | No |
| 0.1010010001… | none exists | No (never repeats) |
Mixed numbers convert to a single fraction by multiplying the whole part by the denominator and adding the numerator: 1 2/3 = (1 × 3 + 2)/3 = 5/3. The improper fraction calculator does that conversion for you.
Rational numbers as decimals: they end or repeat
Here is the practical test. When you write a rational number as a decimal, one of two things happens:
- It terminates (ends):
3/8 = 0.375,7/20 = 0.35. - It repeats a block of digits forever:
1/3 = 0.333…,7/12 = 0.58333…,1/7 = 0.142857142857….
The reverse holds too: every terminating or repeating decimal is rational. A decimal that goes on forever without ever settling into a repeating block is irrational.
Why the digits must repeat
Think about dividing p by q with long division. At every step the remainder is a whole number from 0 to q − 1. If a remainder of 0 appears, the decimal ends. If not, there are only q − 1 possible remainders, so within at most q − 1 steps one of them must come back — and from that point the division repeats exactly what it did before. For 1/7 the remainders cycle through 1, 3, 2, 6, 4, 5 and back to 1, which is why the six digits 142857 repeat.
The repeating block can be long. 1/17 = 0.0588235294117647… repeats a block of 16 digits, the maximum possible for a denominator of 17. Length alone tells you nothing; only an endless pattern with no repeat makes a number irrational.
Which fractions terminate?
Reduce the fraction to lowest terms first. Then it terminates if and only if the denominator has no prime factors other than 2 and 5 — the prime factors of 10.
The last line is why reducing comes first: 15 has a factor of 3, but 3/15 is just 1/5. The fraction to decimal calculator marks the repeating block for any fraction you enter.
Converting decimals back to fractions
Proving a decimal is rational means finding its fraction. There is a method for each kind.
Example: a terminating decimal, 0.625
Write the digits over the matching power of 10, then simplify.
Example: a repeating decimal, 0.272727…
Call the number x. Multiply by 10 raised to the length of the repeating block (here 2 digits, so 100), then subtract to cancel the endless tail.
Example: a delayed repeat, 0.1666…
When the repeat starts after one or more fixed digits, shift twice: once past the fixed part, once past one full block.
The decimal to fraction calculator handles both kinds, and the simplify fractions calculator reduces the result to lowest terms with the GCF shown.
Rational vs irrational numbers
An irrational number is a real number that cannot be written as a fraction of two integers. Its decimal never ends and never repeats. The best-known ones:
- Square roots of non-square integers: √2, √3, √5, √10. The square root of a whole number is either a whole number (√9 = 3) or irrational — never a fraction in between. The list of perfect squares tells you which whole numbers have whole-number roots, and the square root of 2 guide walks through the classic proof that √2 is irrational.
- π ≈ 3.14159, the ratio of a circle’s circumference to its diameter.
- e ≈ 2.71828, the base of natural logarithms.
22/7 is not π
22/7 is rational, so it cannot equal π. It is a close approximation: 22/7 ≈ 3.142857, while π ≈ 3.141593, a difference of about 0.00126. The fraction 355/113 ≈ 3.1415929 is much closer, but still not equal.
Mixing rational and irrational
- Rational + irrational is always irrational:
1 + √2is irrational. - A nonzero rational × an irrational is irrational:
3√2is irrational. - Irrational × irrational can go either way:
√2 × √2 = 2is rational, while√2 × √3 = √6is irrational.
Where rational numbers fit
The number sets nest inside one another. Each set contains everything in the one before it.
| Set | Contains | Example not in the previous set |
|---|---|---|
| Natural numbers ℕ | 1, 2, 3, … (some definitions include 0) | 7 |
| Whole numbers | 0, 1, 2, 3, … | 0 |
| Integers ℤ | …, −2, −1, 0, 1, 2, … | −4 |
| Rational numbers ℚ | Every p/q with q ≠ 0 | −2/3 |
| Real numbers ℝ | Rationals and irrationals | √2 |
So every integer is rational, and every whole number is rational. The details of where 0 belongs at the bottom of this ladder are in whole numbers and natural numbers.
Working with rational numbers
Add, subtract, multiply or divide two rational numbers (except division by zero) and the answer is always rational. In practice, that means fraction arithmetic with signs.
The fraction calculator works these through step by step, and how to add fractions covers the common-denominator step.
There is always another rational in between
Rational numbers are dense: between any two of them, however close, there is another. The average of the two always works. Between 1/4 and 1/3:
You can repeat that forever, so there is no “next” rational number after 1/4. Even so, the rationals leave gaps: √2 sits on the number line with no fraction exactly at its spot.
How to tell if a number is rational
Run through these checks in order. The first one that applies gives the answer.
- Is it an integer, or does it simplify to one? Then it is rational. That includes 0, −12, 18/6 and √49.
- Is it a fraction of two integers with a nonzero bottom? Rational, whether or not it is in lowest terms. 14/21, −9/4 and 100/3 all qualify.
- Is it a decimal that ends, or one with a repeating block? Rational. 2.125 equals 17/8, and 0.454545… equals 5/11.
- Is it the square root of a whole number that is not a perfect square, or a constant like π or e? Irrational.
Percentages follow the same logic, since a percent is a fraction over 100 (the percent to decimal calculator gives the fraction too): 37.5% is 37.5/100 = 3/8, which is rational. In everyday arithmetic — prices, measurements, scores, averages — nearly every number you meet is rational. Irrationals tend to appear only when square roots, circles or exponential growth are involved.
Common mistakes
- “Decimals aren’t rational.” Terminating and repeating decimals are rational. 0.75, 2.5 and 0.333… all are.
- “A long decimal must be irrational.” 1/17 has a 16-digit repeating block and is rational. Only a decimal that never repeats is irrational.
- “Negative numbers aren’t rational.” −2/3 and −8 are rational. The sign has nothing to do with it.
- “0 isn’t rational.”
0 = 0/1, so it is. What is not allowed is a 0 in the denominator. - Judging a square root by its symbol. √16 = 4 is rational; √15 is not. Evaluate before deciding.
- Treating a calculator display as proof. A screen showing 1.414213562 has cut √2 off; the rounded display is rational, but √2 is not.
Frequently asked questions
Is 0 a rational number?
Yes. Zero is rational because it can be written as 0/1, or 0 over any nonzero integer. The rule for rational numbers only forbids zero in the denominator. A fraction like 5/0 is undefined and is not a rational number, but 0/5 = 0 is.
Is 0.333… a rational number?
Yes. A repeating decimal is always rational. Set x = 0.333…, multiply by 10 to get 10x = 3.333…, and subtract: 9x = 3, so x = 3/9 = 1/3. The same method turns any repeating decimal into a fraction of two integers.
Is the square root of 4 rational?
Yes. √4 = 2, and 2 can be written as 2/1. The square root of a perfect square, such as √9 = 3 or √25 = 5, is always rational. The square root of a whole number that is not a perfect square, such as √2 or √5, is irrational.
Is pi a rational number?
No. π is irrational: its decimal, 3.14159265…, never ends and never repeats, and no fraction of two integers equals it. Fractions such as 22/7 ≈ 3.142857 and 355/113 ≈ 3.1415929 are useful approximations, but they are rational, so neither is exactly π.
Are integers rational numbers?
Yes. Every integer is a rational number, because you can write it over 1: 8 = 8/1, −3 = −3/1, 0 = 0/1. The reverse is not true. Rational numbers such as 1/2 or −0.75 fall between integers, so they are rational but not integers.
What is the difference between rational and irrational numbers?
A rational number can be written as a fraction p/q of two integers with q not zero, and its decimal either ends or repeats. An irrational number cannot be written that way, and its decimal goes on forever with no repeating block. 0.75 and 1/3 are rational; √2 and π are irrational.
Is −7 a rational number?
Yes. −7 equals −7/1, a fraction of two integers, so it is rational. It is also an integer. Negative numbers are rational whenever their positive version is, so −2.5 (which is −5/2) and −1/3 are rational too.
Calculators for this
Every one of these shows the working, so you can check the method as well as the answer.
More guides
https://fourfunctioncalculator.com/rational-numbers/