The direct answer: Express the number as a ratio of two integers (a fraction). For decimals, clear the decimal by multiplying by a power of 10; for repeating decimals use an algebraic subtraction trick; for mixed numbers convert to an improper fraction. Irrational numbers (like $\pi$ or $\sqrt2$) cannot be written exactly as fractions.
Explanation & Steps
1) Whole numbers
Any whole number $n$ is $n/1$.
2) Terminating decimals (finite decimal places)
- Count the number of decimal digits $d$.
- Multiply by $10^d$ to remove the decimal, then divide by $10^d$ and simplify.
Example: Convert $2.75$.
- $2.75 \times 100 = 275$ so $2.75 = \dfrac{275}{100}$.
- Simplify by $\gcd(275,100)=25$: $$\dfrac{275}{100}=\dfrac{11}{4}.$$
3) Repeating decimals (periodic)
Let $x$ be the repeating decimal. Multiply $x$ by a power of 10 to align one full repeat, then by a larger power so subtraction eliminates the repeating part.
Example: $x=0.\overline{36}=0.363636\ldots$
- Multiply by $100$: $100x=36.3636\ldots$
- Subtract: $100x-x=36.3636\ldots-0.3636\ldots$
- So $99x=36$, hence $$x=\dfrac{36}{99}=\dfrac{4}{11}.$$
Example: $0.\overline{6}$
- $x=0.\overline{6}$, $10x=6.\overline{6}$, subtract: $9x=6$ so $$x=\dfrac{6}{9}=\dfrac{2}{3}.$$
General method for a decimal with non-repeating part $a$ (length $m$) and repeating block $b$ (length $n$):
$$x=\frac{\text{integer formed by }(a\text{ then }b)-\text{integer formed by }(a)}{10^{m+n}-10^{m}}.$$
4) Mixed numbers
Convert $W\ \frac{p}{q}$ to improper fraction:
$$W+\frac{p}{q}=\frac{Wq+p}{q}.$$
Example: $2\ \frac{3}{5}=\frac{2\cdot5+3}{5}=\frac{13}{5}$.
5) Simplify using GCD
Always divide numerator and denominator by their greatest common divisor.
Important note
Irrational numbers cannot be exactly written as fractions — you can only give rational approximations (e.g., $\pi\approx\dfrac{22}{7}$).
If you have a particular number you want converted, tell me the number and I’ll convert it step-by-step.