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
Fraction
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.
Common fractions
| 1/2 | 0.5 |
| 1/3 | 0.3333… |
| 2/3 | 0.6667… |
| 1/4 | 0.25 |
| 3/4 | 0.75 |
| 1/5 | 0.2 |
| 1/6 | 0.1667… |
| 1/8 | 0.125 |
| 1/10 | 0.1 |
| 1/12 | 0.0833… |
| 1/16 | 0.0625 |
| 1/100 | 0.01 |
Sixteenth-inch reference
| inch | decimal | mm |
|---|---|---|
| 1/16″ | 0.0625 | 1.59 |
| 1/8″ | 0.1250 | 3.17 |
| 3/16″ | 0.1875 | 4.76 |
| 1/4″ | 0.2500 | 6.35 |
| 5/16″ | 0.3125 | 7.94 |
| 3/8″ | 0.3750 | 9.52 |
| 7/16″ | 0.4375 | 11.11 |
| 1/2″ | 0.5000 | 12.70 |
| 9/16″ | 0.5625 | 14.29 |
| 5/8″ | 0.6250 | 15.88 |
| 11/16″ | 0.6875 | 17.46 |
| 3/4″ | 0.7500 | 19.05 |
| 13/16″ | 0.8125 | 20.64 |
| 7/8″ | 0.8750 | 22.22 |
| 15/16″ | 0.9375 | 23.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
- Edit either side — typing in the decimal box updates the fraction; typing in the fraction box updates the decimal.
- 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.
- Look at the binary-fraction strip if you need a power-of-2 denominator (1/64" carpentry, 1/32" machining, etc.).
- 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'.
- 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
CSS Unit Converter
Convert between px, rem, em, pt, vw, vh, and % using your own base font size and viewport.
JSON ↔ YAML Converter
Convert JSON to YAML or YAML to JSON — pick the indent and copy the result.
Data Size Converter
Convert between bytes, KB, MB, GB, TB — in decimal (1000) or binary (1024).
Roman Numeral Converter
Convert between Arabic numbers and Roman numerals from 1 to 3999.
Number Base Converter
Convert numbers between binary, octal, decimal, and hexadecimal.
Unit Converter
Convert length, weight, temperature, area, volume, speed, and time.