Skip to content
Rational and Irrational Numbers

Rational and Irrational Numbers

By the end of this section, you will be able to: identify rational numbers and irrational numbers, and classify different types of real numbers.

Identify rational numbers and irrational numbers

We have already described numbers as counting numbers, whole numbers, and integers. Do you remember what the difference is among these types of numbers?

counting numbers1,2,3,41, 2, 3, 4\ldots
whole numbers0,1,2,3,40, 1, 2, 3, 4\ldots
integers3,2,1,0,1,2,3,4\ldots -3, -2, -1, 0, 1, 2, 3, 4\ldots

Rational numbers

What type of numbers would you get if you started with all the integers and then included all the fractions? The numbers you would have form the set of rational numbers.

Rational number. A rational number is a number that can be written in the form pq\tfrac{p}{q}, where pp and qq are integers and q0q \neq 0.

All fractions, both positive and negative, are rational numbers. A few examples are

45,78,134, and 203\tfrac{4}{5}, -\tfrac{7}{8}, \tfrac{13}{4}, \text{ and } -\tfrac{20}{3}

Each numerator and each denominator is an integer.

We need to look at all the numbers we have used so far and verify that they are rational. The definition of rational numbers tells us that all fractions are rational. We will now look at the counting numbers, whole numbers, integers, and decimals to make sure they are rational.

Are integers rational numbers? To decide, we try to write each one as a ratio of two integers. An easy way to do this is to write it as a fraction with denominator one.

3=318=810=013 = \tfrac{3}{1} \qquad -8 = \tfrac{-8}{1} \qquad 0 = \tfrac{0}{1}

Since any integer can be written as the ratio of two integers, all integers are rational numbers. Remember that all the counting numbers and all the whole numbers are also integers, and so they, too, are rational.

What about decimals? Are they rational? Let’s look at a few to see if we can write each of them as the ratio of two integers. We’ve already seen that integers are rational numbers — the integer 8-8 could be written as the decimal 8.0-8.0. So, clearly, some decimals are rational.

Think about the decimal 7.37.3. Can we write it as a ratio of two integers? Because 7.37.3 means 73107\tfrac{3}{10}, we can write it as an improper fraction, 7310\tfrac{73}{10}. So 7.37.3 is the ratio of the integers 7373 and 1010. It is a rational number.

In general, any decimal that ends after a number of digits (such as 7.37.3 or 1.2684-1.2684) is a rational number. We simply write it as a mixed number and then convert it to an improper fraction. Every one of the numbers we have used so far can be summarized this way:

FractionsIntegers
Number45,78,134,203\tfrac{4}{5}, -\tfrac{7}{8}, \tfrac{13}{4}, -\tfrac{20}{3}2,1,0,1,2,3-2, -1, 0, 1, 2, 3
Ratio of integers45,78,134,203\tfrac{4}{5}, \tfrac{-7}{8}, \tfrac{13}{4}, \tfrac{-20}{3}21,11,01,11,21,31\tfrac{-2}{1}, \tfrac{-1}{1}, \tfrac{0}{1}, \tfrac{1}{1}, \tfrac{2}{1}, \tfrac{3}{1}
Decimal number0.8,0.875,3.25,6.60.8, -0.875, 3.25, -6.\overline{6}2.0,1.0,0.0,1.0,2.0,3.0-2.0, -1.0, 0.0, 1.0, 2.0, 3.0

Example. Write each as the ratio of two integers: (a) 15-15 (b) 6.816.81 (c) 367-3\tfrac{6}{7}.

(a) Write the integer as a fraction with denominator 11:

15=151-15 = \tfrac{-15}{1}

(b) Write the decimal as a mixed number, then convert it to an improper fraction:

6.81=681100=6811006.81 = 6\tfrac{81}{100} = \tfrac{681}{100}

(c) Convert the mixed number to an improper fraction:

367=277-3\tfrac{6}{7} = -\tfrac{27}{7}

Write 3.573.57 as the ratio of two integers, in lowest terms.

Write 8.418.41 as the ratio of two integers, in lowest terms.

Let’s look at the decimal form of the numbers we know are rational. We have seen that every integer is a rational number, since a=a1a = \tfrac{a}{1} for any integer aa. We can also change any integer to a decimal by adding a decimal point and a zero: 2,1,0,1,2,3-2, -1, 0, 1, 2, 3 become 2.0,1.0,0.0,1.0,2.0,3.0-2.0, -1.0, 0.0, 1.0, 2.0, 3.0 — these decimals stop.

We have also seen that every fraction is a rational number. Look at the decimal form of the fractions we just considered:

45=0.878=0.875134=3.25203=6.6 \tfrac{4}{5} = 0.8 \qquad -\tfrac{7}{8} = -0.875 \qquad \tfrac{13}{4} = 3.25 \qquad -\tfrac{20}{3} = -6.\overline{6}

These decimals either stop, or they repeat. What do these examples tell us? Every rational number can be written both as a ratio of integers and as a decimal that either stops or repeats.

Irrational numbers

Are there any decimals that do not stop or repeat? Yes. The number π\pi (the Greek letter pi, pronounced “pie”), which is very important in describing circles, has a decimal form that does not stop or repeat:

π=3.141592654\pi = 3.141592654\ldots

Similarly, the decimal representations of square roots of whole numbers that are not perfect squares never stop and never repeat. For example,

5=2.236067978\sqrt{5} = 2.236067978\ldots

A decimal that does not stop and does not repeat cannot be written as the ratio of integers. We call this kind of number an irrational number.

Irrational number. An irrational number is a number that cannot be written as the ratio of two integers. Its decimal form does not stop and does not repeat.

Let’s summarize a method we can use to determine whether a number is rational or irrational: if the decimal form of a number stops or repeats, the number is rational; if it does not stop and does not repeat, the number is irrational.

Example. Identify each of the following as rational or irrational: (a) 0.5830.58\overline{3} (b) 0.4750.475 (c) 3.6055512753.605551275\ldots

(a) The bar above the 33 indicates that it repeats. Therefore 0.5830.58\overline{3} is a repeating decimal, and is therefore a rational number.

(b) This decimal stops after the 55, so it is a rational number.

(c) The ellipsis (\ldots) means that this number does not stop. There is no repeating pattern of digits. Since the number doesn’t stop and doesn’t repeat, it is irrational.

How many of these three numbers are irrational: 0.290.29, 0.8166660.816666\ldots (the 6 repeats forever), and 2.5151151112.515115111\ldots?

How many of these three numbers are irrational: 0.2333330.233333\ldots (the 3 repeats forever), 0.1250.125, and 0.4183020.418302\ldots?

Let’s think about square roots now. Square roots of perfect squares are always whole numbers, so they are rational. But the decimal forms of square roots of numbers that are not perfect squares never stop and never repeat, so these square roots are irrational.

Example. Identify each of the following as rational or irrational: (a) 36\sqrt{36} (b) 44\sqrt{44}.

(a) The number 3636 is a perfect square, since 62=366^2 = 36. So 36=6\sqrt{36} = 6. Therefore 36\sqrt{36} is rational.

(b) Remember that 62=366^2 = 36 and 72=497^2 = 49, so 4444 is not a perfect square. This means 44\sqrt{44} is irrational.

Evaluate 81\sqrt{81}.

How many of these two square roots are irrational: 116\sqrt{116} and 121\sqrt{121}?

Classify real numbers

We have seen that all counting numbers are whole numbers, all whole numbers are integers, and all integers are rational numbers. Irrational numbers are a separate category of their own. When we put together the rational numbers and the irrational numbers, we get the set of real numbers.

The diagram below illustrates how the number sets are related: counting numbers sit inside whole numbers, which sit inside integers, which sit inside rational numbers; rational numbers and irrational numbers together make up the real numbers.

Real NumbersRational NumbersIntegersWhole NumbersCountingNumbersIrrationalNumbers
Real number. A real number is a number that is either rational or irrational.

Does the term “real numbers” seem strange to you? Are there any numbers that are not “real,” and, if so, what could they be? For centuries, the only numbers people knew about were what we now call the real numbers. Then mathematicians discovered the set of imaginary numbers. You won’t encounter imaginary numbers in this course, but you will later on in your studies of algebra.

Example. Determine whether each of the numbers in the following list is a (a) whole number (b) integer (c) rational number (d) irrational number and (e) real number:

7,145,8,5,5.9,64-7, \tfrac{14}{5}, 8, \sqrt{5}, 5.9, -\sqrt{64}

(a) The whole numbers are 0,1,2,3,0, 1, 2, 3, \ldots The number 88 is the only whole number given.

(b) The integers are the whole numbers, their opposites, and 00. From the given numbers, 7-7 and 88 are integers. Also, notice that 6464 is the square of 88, so 64=8-\sqrt{64} = -8. So the integers are 7,8,64-7, 8, -\sqrt{64}.

(c) Since all integers are rational, the numbers 7,8,-7, 8, and 64-\sqrt{64} are also rational. Rational numbers also include fractions and decimals that terminate or repeat, so 145\tfrac{14}{5} and 5.95.9 are rational.

(d) The number 55 is not a perfect square, so 5\sqrt{5} is irrational.

(e) All of the numbers listed are real.

We can summarize the results in a table:

NumberWholeIntegerRationalIrrationalReal
7-7
145\tfrac{14}{5}
88
5\sqrt{5}
5.95.9
64-\sqrt{64}

How many of these numbers are integers: 3-3, 2-\sqrt{2}, 0.33330.3333\ldots (repeating), 95\tfrac{9}{5}, 44, 49\sqrt{49}?

How many of these numbers are whole numbers: 25-\sqrt{25}, 38-\tfrac{3}{8}, 1-1, 66, 121\sqrt{121}, 2.0419752.041975\ldots?

Key terms

rational number — a number that can be written as pq\tfrac{p}{q}, where pp and qq are integers and q0q \neq 0; its decimal form stops or repeats. irrational number — a number that cannot be written as the ratio of two integers; its decimal form neither stops nor repeats. real number — a number that is either rational or irrational.


This section is adapted from Prealgebra 2e, Section 7.1: Rational and Irrational Numbers by Lynn Marecek, MaryAnne Anthony-Smith, and Andrea Honeycutt Mathis, © OpenStax, licensed under CC BY-NC-SA 4.0. Access the original for free at openstax.org. Changes: recreated the nested real-number-sets diagram as an accessible inline graphic; omitted the Be Prepared quiz, media links, and end-of-section exercises; and converted the practice problems (“Try Its”) into interactive exercises with instant feedback, rephrasing the rational-vs-irrational classification problems as counting questions so they can be graded as math expressions.