# Is this number rational or irrational?

Tells whether a number is rational or irrational, with the reason: fractions, terminating and repeating decimals, square and cube roots, π, e and simple expressions such as (1 + √5)/2.

- Page: https://www.acalculator.org/math/rational-or-irrational-calculator
- JSON spec: https://www.acalculator.org/math/rational-or-irrational-calculator.json
- Version: a5bf367455d7

## Default answer

Example with the default inputs (Number √2): Is √2 rational or irrational? Irrational. It is √2, and 2 is not the square of a fraction, so its square root is irrational.

## Inputs

| Key | Label | Description |
| --- | --- | --- |
| x | Number | A number or a short expression: 3/4, 0.75, 0.(3), 0.333…, √2, ∛9, 2π, e/3 or (1 + √5)/2. |

## Outputs

| Key | Label | Description |
| --- | --- | --- |
| result | Rational or irrational | Whether the number is rational or irrational. |
| reason | Why | The reason, from its exact value. |
| exact | Exact value | The number in simplest exact form: a fraction, or a fraction plus a multiple of one root or constant. |
| fraction | As a fraction | A rational number as p/q in lowest terms. |
| decimal | Decimal | The exact decimal of a rational number, with a bar over the repeating digits. |
| decimalType | Decimal type | Whether the decimal ends, repeats, or does neither. |
| approx | Approximate value | The number to 12 significant figures. |
| sets | Number sets | The sets of numbers it belongs to: counting, whole, integer, rational, irrational, real. |

## Method

Read the number exactly as a + b·X, with a and b fractions and X one of √r, ∛r, π, 1/π, e, 1/e. It is rational when b = 0 (√r and ∛r count as rational when r is a square or a cube of a fraction), and irrational otherwise.

## Assumptions

- Decimals are read exactly: 0.75 is 3/4, and repeating digits are marked with brackets, 0.1(6), or typed twice before dots, 0.1666….
- π and e are irrational; so is the square root of a fraction that is not a square, and the cube root of one that is not a cube.
- Expressions mixing two kinds of irrational part (√2 + √3, π + e) are not read.

## Worked examples

1. x = √2 gives result = Irrational, reason = It is √2, and 2 is not the square of a fraction, so its square root is irrational., approx = 1.41421356237. Source: OpenStax, Prealgebra 2e, §7.1 Rational and Irrational Numbers (a rational number can be written as a ratio of two integers; its decimal stops or repeats; square roots of whole numbers that are not perfect squares and π do not stop or repeat; Example 7.2: 0.583̅ and 0.475 are rational, 3.605551275… is irrational; Example 7.3: √36 = 6 is rational, √44 is irrational; Example 7.4: classifying counting, whole, integer, rational, irrational and real numbers), https://openstax.org/books/prealgebra-2e/pages/7-1-rational-and-irrational-numbers (retrieved 2026-10-19).
2. x = √36 gives result = Rational, fraction = 6, sets = Counting number, whole number, integer, rational number, real number. Source: OpenStax, Prealgebra 2e, §7.1 Rational and Irrational Numbers (a rational number can be written as a ratio of two integers; its decimal stops or repeats; square roots of whole numbers that are not perfect squares and π do not stop or repeat; Example 7.2: 0.583̅ and 0.475 are rational, 3.605551275… is irrational; Example 7.3: √36 = 6 is rational, √44 is irrational; Example 7.4: classifying counting, whole, integer, rational, irrational and real numbers), https://openstax.org/books/prealgebra-2e/pages/7-1-rational-and-irrational-numbers (retrieved 2026-10-19).
3. x = √44 gives result = Irrational, exact = 2√11, decimalType = neither ends nor repeats. Source: OpenStax, Prealgebra 2e, §7.1 Rational and Irrational Numbers (a rational number can be written as a ratio of two integers; its decimal stops or repeats; square roots of whole numbers that are not perfect squares and π do not stop or repeat; Example 7.2: 0.583̅ and 0.475 are rational, 3.605551275… is irrational; Example 7.3: √36 = 6 is rational, √44 is irrational; Example 7.4: classifying counting, whole, integer, rational, irrational and real numbers), https://openstax.org/books/prealgebra-2e/pages/7-1-rational-and-irrational-numbers (retrieved 2026-10-19).
4. x = 0.58(3) gives result = Rational, fraction = 7/12, decimal = 0.583̅, decimalType = repeats. Source: OpenStax, Prealgebra 2e, §7.1 Rational and Irrational Numbers (a rational number can be written as a ratio of two integers; its decimal stops or repeats; square roots of whole numbers that are not perfect squares and π do not stop or repeat; Example 7.2: 0.583̅ and 0.475 are rational, 3.605551275… is irrational; Example 7.3: √36 = 6 is rational, √44 is irrational; Example 7.4: classifying counting, whole, integer, rational, irrational and real numbers), https://openstax.org/books/prealgebra-2e/pages/7-1-rational-and-irrational-numbers (retrieved 2026-10-19).
5. x = 0.475 gives result = Rational, fraction = 19/40, decimalType = ends, reason = It equals 19/40, a ratio of two integers.. Source: OpenStax, Prealgebra 2e, §7.1 Rational and Irrational Numbers (a rational number can be written as a ratio of two integers; its decimal stops or repeats; square roots of whole numbers that are not perfect squares and π do not stop or repeat; Example 7.2: 0.583̅ and 0.475 are rational, 3.605551275… is irrational; Example 7.3: √36 = 6 is rational, √44 is irrational; Example 7.4: classifying counting, whole, integer, rational, irrational and real numbers), https://openstax.org/books/prealgebra-2e/pages/7-1-rational-and-irrational-numbers (retrieved 2026-10-19).
6. x = (1 + √5)/2 gives result = Irrational, exact = 1/2 + (1/2)√5, approx = 1.61803398875. Source: OpenStax, Prealgebra 2e, §7.1 Rational and Irrational Numbers (a rational number can be written as a ratio of two integers; its decimal stops or repeats; square roots of whole numbers that are not perfect squares and π do not stop or repeat; Example 7.2: 0.583̅ and 0.475 are rational, 3.605551275… is irrational; Example 7.3: √36 = 6 is rational, √44 is irrational; Example 7.4: classifying counting, whole, integer, rational, irrational and real numbers), https://openstax.org/books/prealgebra-2e/pages/7-1-rational-and-irrational-numbers (retrieved 2026-10-19).
7. x = √2 × √8 gives result = Rational, fraction = 4. Source: OpenStax, Prealgebra 2e, §7.1 Rational and Irrational Numbers (a rational number can be written as a ratio of two integers; its decimal stops or repeats; square roots of whole numbers that are not perfect squares and π do not stop or repeat; Example 7.2: 0.583̅ and 0.475 are rational, 3.605551275… is irrational; Example 7.3: √36 = 6 is rational, √44 is irrational; Example 7.4: classifying counting, whole, integer, rational, irrational and real numbers), https://openstax.org/books/prealgebra-2e/pages/7-1-rational-and-irrational-numbers (retrieved 2026-10-19).
8. x = 2π/3 gives result = Irrational, exact = (2/3)π, reason = It is (2/3)π, and π is irrational.. Source: OpenStax, Prealgebra 2e, §7.1 Rational and Irrational Numbers (a rational number can be written as a ratio of two integers; its decimal stops or repeats; square roots of whole numbers that are not perfect squares and π do not stop or repeat; Example 7.2: 0.583̅ and 0.475 are rational, 3.605551275… is irrational; Example 7.3: √36 = 6 is rational, √44 is irrational; Example 7.4: classifying counting, whole, integer, rational, irrational and real numbers), https://openstax.org/books/prealgebra-2e/pages/7-1-rational-and-irrational-numbers (retrieved 2026-10-19).
9. x = e gives result = Irrational, sets = Irrational number, real number, approx = 2.71828182846. Source: OpenStax, College Algebra 2e, §6.1 Exponential Functions (e is an irrational number: its decimal goes on forever without repeating), https://openstax.org/books/college-algebra-2e/pages/6-1-exponential-functions (retrieved 2026-10-19).
10. x = 0.1666... gives fraction = 1/6, decimal = 0.16̅. Source: OpenStax, Prealgebra 2e, §7.1 Rational and Irrational Numbers (a rational number can be written as a ratio of two integers; its decimal stops or repeats; square roots of whole numbers that are not perfect squares and π do not stop or repeat; Example 7.2: 0.583̅ and 0.475 are rational, 3.605551275… is irrational; Example 7.3: √36 = 6 is rational, √44 is irrational; Example 7.4: classifying counting, whole, integer, rational, irrational and real numbers), https://openstax.org/books/prealgebra-2e/pages/7-1-rational-and-irrational-numbers (retrieved 2026-10-19).
11. x = ∛27/8 gives result = Rational, fraction = 3/8. Source: OpenStax, Prealgebra 2e, §7.1 Rational and Irrational Numbers (a rational number can be written as a ratio of two integers; its decimal stops or repeats; square roots of whole numbers that are not perfect squares and π do not stop or repeat; Example 7.2: 0.583̅ and 0.475 are rational, 3.605551275… is irrational; Example 7.3: √36 = 6 is rational, √44 is irrational; Example 7.4: classifying counting, whole, integer, rational, irrational and real numbers), https://openstax.org/books/prealgebra-2e/pages/7-1-rational-and-irrational-numbers (retrieved 2026-10-19).
12. x = -22/7 gives result = Rational, decimal = −3.1̅4̅2̅8̅5̅7̅, sets = Rational number, real number. Source: OpenStax, Prealgebra 2e, §7.1 Rational and Irrational Numbers (a rational number can be written as a ratio of two integers; its decimal stops or repeats; square roots of whole numbers that are not perfect squares and π do not stop or repeat; Example 7.2: 0.583̅ and 0.475 are rational, 3.605551275… is irrational; Example 7.3: √36 = 6 is rational, √44 is irrational; Example 7.4: classifying counting, whole, integer, rational, irrational and real numbers), https://openstax.org/books/prealgebra-2e/pages/7-1-rational-and-irrational-numbers (retrieved 2026-10-19).

## FAQ

### How do you know if a number is rational or irrational?

A rational number can be written as a ratio of two integers, p/q; its decimal either ends or repeats. An irrational number cannot, and its decimal goes on forever without repeating (OpenStax Prealgebra 2e §7.1).

### Is a repeating decimal rational?

Yes. Every repeating decimal is a fraction: 0.583 with the 3 repeating is (583 − 58) ÷ 900 = 7/12. Type it as 0.58(3) or 0.58333….

### Is the square root of 2 rational or irrational?

Irrational. √n is rational only when n is a perfect square: √36 = 6 is rational, but √2 and √44 are irrational. For a fraction, √(p/q) in lowest terms is rational only when p and q are both perfect squares: √(4/9) = 2/3.

### Is π rational or irrational?

Irrational: its decimal 3.14159… never ends or repeats. 22/7 and 3.14 are close to π but are rational, because they are fractions.

### Is 0 rational?

Yes. 0 = 0/1, a ratio of two integers. It is a whole number and an integer as well.

### Is a rational number plus an irrational number irrational?

Always. If r + x were rational for a rational r, then x would be that number minus r, which is rational. The same holds for a nonzero rational times an irrational, so 1 + √2 and 2π/3 are irrational.

### Is π + e rational?

No one knows. Whether π + e or π × e is rational is an open question in mathematics, so the calculator does not answer it.

## Sources

- OpenStax, Prealgebra 2e, §7.1 Rational and Irrational Numbers: a rational number can be written as a ratio of two integers and its decimal stops or repeats; an irrational number cannot be, and its decimal does not stop or repeat; square roots of whole numbers that are not perfect squares and π are irrational; Examples 7.2 (0.583̅ and 0.475 are rational, 3.605551275… is irrational), 7.3 (√36 = 6 is rational, √44 is irrational) and 7.4 (counting, whole, integer, rational, irrational and real numbers), retrieved 2026-10-19. https://openstax.org/books/prealgebra-2e/pages/7-1-rational-and-irrational-numbers
- OpenStax, College Algebra 2e, §6.1 Exponential Functions: e ≈ 2.718282 is an irrational number, whose decimal goes on forever without repeating, retrieved 2026-10-19. https://openstax.org/books/college-algebra-2e/pages/6-1-exponential-functions
