AZ Tools

Decimal ↔ Fraction Converter (with Inch-Fraction Table)

Convert

Two-way converter between decimals and fractions, with a focus on the practical cases — cooking measurements, woodworking and machining (inch fractions), engineering tolerances, and probability/ratio work. The decimal-to-fraction side uses brute-force best-rational search bounded by a max-denominator you control (2, 4, 8, 16, 32, 64, 100, or 1000), so you can request 'closest 1/16th' for woodworking or 'closest 1/100' for percent rounding. It reports both the reduced and mixed-number forms and the rounding error vs the exact decimal. The fraction-to-decimal side accepts whole-number + numerator/denominator (e.g., 1 5/8), computes the exact decimal at 10 significant digits, the percent equivalent, and the GCD-reduced form. A dedicated binary-fraction panel shows the closest 1/2, 1/4, 1/8, 1/16, 1/32, and 1/64 approximations side by side — useful when your tape measure or CAD grid only supports those steps. Below that, reference tables for common fractions (1/2, 1/3, 1/4, …) and 16-th inch fractions (with inch decimal and mm equivalents) make it a one-page lookup tool. All math runs locally; nothing leaves your browser.

Decimal

Reduced5/8
Errorexact

Fraction

/
WholeNumeratorDenominator
Decimal0.625
Percent62.5%

Binary fractions (power-of-2 denominators)

Closest 1/2, 1/4, 1/8, 1/16, 1/32, 1/64 — handy for tape measures, pixel grids, and fixed-point math.

1/2
±1.3e-1
3/4
±1.3e-1
5/8
exact
5/8
exact
5/8
exact
5/8
exact

Common fractions

1/20.5
1/30.3333…
2/30.6667…
1/40.25
3/40.75
1/50.2
1/60.1667…
1/80.125
1/100.1
1/120.0833…
1/160.0625
1/1000.01

Sixteenth-inch reference

inchdecimalmm
1/16″0.06251.59
1/8″0.12503.17
3/16″0.18754.76
1/4″0.25006.35
5/16″0.31257.94
3/8″0.37509.52
7/16″0.437511.11
1/2″0.500012.70
9/16″0.562514.29
5/8″0.625015.88
11/16″0.687517.46
3/4″0.750019.05
13/16″0.812520.64
7/8″0.875022.22
15/16″0.937523.81
About the conversion

Decimal → fraction uses brute-force search: for each denominator d from 1 to your max, it picks the integer numerator closest to decimal × d, then keeps the (n,d) with the smallest error. Maximum denominator is your knob — small (16, 32, 64) finds 'practical' fractions for measurements; large (1000) finds near-exact rationals for percentages and tax rates. Fraction → decimal is straight division at 10 significant digits, plus a GCD-reduced form. The binary-fraction strip rounds the decimal to each power-of-2 denominator independently, so you can compare how close 1/64 is to 1/16 for the same value. Everything runs locally — no server.

How to use

  1. Edit either side — typing in the decimal box updates the fraction; typing in the fraction box updates the decimal.
  2. Pick a maximum denominator to control how the decimal gets rounded to a fraction. 16 is the woodworking default; 100 is good for percent-ish; 1000 nails most everyday decimals exactly.
  3. Look at the binary-fraction strip if you need a power-of-2 denominator (1/64" carpentry, 1/32" machining, etc.).
  4. Use the reduced output if you need a simplified fraction; use the mixed-number form if you'd prefer '1 5/8' over '13/8'.
  5. The error row tells you whether the fraction is exact or off by some tiny epsilon — pick a higher max denominator if the error matters.

Frequently asked questions

How does it pick the 'best' fraction?
For each denominator d from 1 up to your max, it computes the nearest integer numerator n = round(decimal × d) and measures the error |decimal − n/d|. The (n,d) pair with the smallest error wins, with ties broken by smaller denominator. This is exhaustive but fast — even maxDenom = 1000 finishes in microseconds. The continued-fraction algorithm would also work and is asymptotically faster, but for the denominators a human cares about, brute force is simpler and indistinguishable in speed.
Why does 0.1 not give exactly 1/10 sometimes?
0.1 in IEEE 754 binary floating point is actually 0.1000000000000000055511151231257827021181583404541015625 — there's no exact binary representation. As long as your max denominator is at least 10, the search finds 1/10 because the error there (~5.5e-18) is the smallest. With smaller maxDenom (say 8), you'll get the closest available like 1/8 or 1/9 with a visible error. The 'exact' label only shows when the difference is below 1e-12.
Why is 1/3 never exact?
1/3 = 0.333333… — a repeating decimal with no finite representation. The decimal-to-fraction side recognizes 1/3 immediately if you type the fraction directly (just 1 / 3). But typing 0.333 gives you 333/1000 if your max is 1000, or 1/3 only if your max is at least 3 AND your decimal has enough trailing 3s. To force fractions like 1/3 from a decimal, type at least 0.33333 and use a max denom of 3, 6, or higher.
What's the binary-fraction panel for?
Anywhere the denominator must be a power of 2: imperial measurements (tape measures stop at 1/16 or 1/32), pixel-snap grids, dithering kernels, audio bit-depth quantization, and any binary-fixed-point system. The panel shows all six power-of-2 denominators at once with their rounding errors, so you can see whether 1/8" is close enough or you need to step up to 1/64".
Does it handle negatives and mixed numbers?
Yes. Decimals can be negative ("-0.625" → -5/8). On the fraction side, fill the whole-number box for mixed numbers — "1" / "5" / "8" means 1 + 5/8 = 13/8 = 1.625. The decimal-to-fraction display automatically chooses mixed form when the numerator exceeds the denominator.

Related tools