# Decimal to Fraction Calculator

- **URL:** https://codeasystem.com/calculators/math/decimal-to-fraction-calculator/
- **Category:** math
- **Description:** Convert any decimal into its simplest fraction using continued fractions, with mixed-number output and honest notes when only an approximation exists.
- **Primary output:** Fraction: 11/4

## Inputs
- Decimal value (name: `value`, type: number, example: 2.75)

## Outputs
- Fraction: 11/4
- Mixed number: 2 3/4
- Denominator cap used: 1,000,000

## Formula / methodology
```
Continued-fraction convergents p/q minimise |x − p/q| with q ≤ 1,000,000
```

The decimal is expanded into a continued fraction whose convergents give the best rational approximations at every denominator size. We take the first convergent reproducing your input within floating-point precision, capped at a denominator of one million; values with no exact small fraction (like π) get the closest achievable approximation, flagged honestly.

## Assumptions & limitations
- Denominators above 1,000,000 are not searched.
- Floating-point input itself limits precision beyond about fifteen significant digits.
- Mixed numbers appear only for values whose absolute value exceeds one.

## How to use
1. **Enter the decimal**; Positive, negative or zero; terminating or long-repeating alike.
2. **Read the simplified fraction**; Already reduced to lowest terms via the GCD.
3. **Check the extras**; Values over one also show a mixed-number form; approximate matches say so explicitly.

## Example
2.75 converts exactly to 11/4, shown as the mixed number 2 3/4.

Result for these inputs:

```
Fraction: 11/4
```

## About this calculator
### How the search stays fast and correct

Brute-forcing denominators from 1 to a million works but wastes effort; continued-fraction convergents jump straight to the best candidate at each size, because number theory guarantees no smaller denominator fits between consecutive convergents. That is why π collapses to 355/113 so quickly.

### Exact versus approximate, stated plainly

Terminating decimals like 0.375 map to exact fractions (3/8). Irrational-ish inputs cannot match exactly within any denominator cap, so the note tells you the result is the best approximation found; no silent fudging either way.

### Where mixed numbers help

Cooking and carpentry live in mixed units: 11/4 cups reads awkwardly while “2 and 3/4 cups” pours cleanly. Both forms are offered whenever the improper fraction exceeds one.

## FAQs
### Why did I get an approximation notice?

Your decimal likely came from an irrational quantity or was rounded somewhere upstream; the tool returns the closest simple fraction below the denominator cap and tells you.

### Are negative decimals supported?

Yes; the sign attaches to the numerator, e.g. −0.75 becomes −3/4.

### What about repeating decimals like 0.333…?

Enter enough digits (e.g. 0.3333333333) and the convergent search recovers 1/3 exactly within tolerance.

### Is the fraction always in lowest terms?

Yes; convergents arrive reduced, and a final GCD pass guarantees it regardless.

## Related calculators
- [Ratio Calculator](https://codeasystem.com/calculators/math/ratio-calculator/)
- [GCD & LCM Calculator](https://codeasystem.com/calculators/math/gcd-lcm-calculator/)
- [Length Converter](https://codeasystem.com/calculators/conversion/length-converter/)

---
Last updated: 2026-08-23 · Version: 1.0.0 · [HTML version](https://codeasystem.com/calculators/math/decimal-to-fraction-calculator/)
