Skip to content
CalculatorAtlas

Ratio to Fraction Calculator

Tested

Convert a ratio a:b to a fraction a/b.

Tested, not yet published. The formula for this calculator is implemented and passes its automated checks. This page stays non-indexable until it is reviewed and published.

Results

Enter your values and press Calculate. Results appear here.

  • • Result

Quick answer

A ratio a : b can be written as the fraction a/b. The ratio 3 : 4 is the fraction 3/4.

Enter whole-number parts. The calculator returns the fraction.

Related tools: Fraction to Ratio Calculator: Convert a fraction to a ratio. Fraction Calculator: Add, subtract, multiply and divide fractions with simplified and mixed-number results. Ratio Calculator: Simplify a ratio of two whole numbers.

How to use the Ratio to Fraction Calculator

  1. Enter a (a whole number, 0 or more).
  2. Enter b (a whole number, 1 or more).
  3. Press Calculate to see the result, and use Reset to start again.
Inputs of the Ratio to Fraction Calculator
InputWhat to enterAllowed values
AA whole number≥ 0
BA whole number≥ 1

Formula and method

Formula

a : b = a/b

IEEE-754 double precision; shown to at most 6 decimal places.

Direct conversion using the GCD to simplify.

Worked examples

These examples are verified: each one is an automated test case that the live calculator must reproduce exactly.

Example 1

Inputs: A = 3; B = 4.

Results of example 1
ResultValue
Fraction3/4

Example 2

Inputs: A = 10; B = 4.

Results of example 2
ResultValue
Fraction5/2

The first line is the headline result (fraction). IEEE-754 double precision; shown to at most 6 decimal places.

Part to part versus part to whole

The fraction 3/4 compares A to B. If the ratio describes parts of a whole, A is 3/(3 + 4) = 3/7 of the whole. Choose the version you need.

Simplifying

6 : 8 gives 6/8, which simplifies to 3/4. Both values must be whole numbers and the second must be positive.

From a ratio to shares of a total

The calculator reads a : b as the fraction a/b, so 3:4 gives 3/4. If 3 and 4 are two parts of one group, such as boys and girls, each share of the total is 3/7 and 4/7 instead.

For a three-part ratio such as 2:3:5, add the parts to get 10 and divide each by 10: the shares are 1/5, 3/10 and 1/2.

How the result changes with a

Holding every other input at the first worked example, this table changes only a. It shows how sensitive the answer is to that one value; each row was produced by running this calculator.

How the result changes with a
AFraction
21/2
33/4
63/2
123

What happens with invalid input

These messages are produced by the calculator itself, so you know what to fix.

  • B: entering "0" shows "B must be at least 1." beside that field and no result.

Choosing between the Ratio to Fraction Calculator and similar calculators

Each row shows what a related calculator on this site asks for and what it returns, so you can pick the one that matches your question.

Choosing between the Ratio to Fraction Calculator and similar calculators
CalculatorYou enterIt returns
[Fraction to Ratio Calculator](/math/fraction-to-ratio-calculator/)numerator and denominatorRatio
[Fraction Calculator](/math/fraction-calculator/)numerator 1, denominator 1 and operationResult
[Ratio Calculator](/math/ratio-calculator/)first number and second numberSimplified ratio
[Inch Fraction Calculator](/math/inch-fraction-calculator/)decimal inches and nearestNearest fraction
[Fraction to Decimal Calculator](/math/fraction-to-decimal-calculator/)numerator and denominatorDecimal

Background: rounding and basic arithmetic

Rounding to a place looks at the digit just to its right: 0 to 4 rounds down and 5 to 9 rounds up (the half-up convention, so 2.5 becomes 3). Rounding 838.274 gives 800 to the nearest hundred, 840 to the nearest ten and 838 to the nearest one.

Some systems use banker's rounding (half to even), which sends 2.5 to 2 and 3.5 to 4; check which convention your task requires, and round only at the end of a multi-step calculation.

Assumptions and limitations

  • Whole numbers
  • Second value must be positive

If a required value is empty, not a number, or outside its allowed range, the form marks that field with a message and shows no result instead of a misleading number. The automated checks deliberately try invalid entries for b to confirm this.

Frequently asked questions

What fraction is 2:5?

2/5 as part to part; 2/7 of the whole.

What is 1:3 as a fraction of the whole?

In the ratio 1:3 the first part is 1 of 4 equal parts, so it's 1/4 of the whole.

Can a ratio have a decimal?

Scale to whole numbers first.

How do I turn a three-part ratio into fractions?

Add the parts and divide each part by the total. For 2:3:5 the total is 10, so the fractions are 2/10, 3/10 and 5/10.

Are 6:8 and 3:4 the same ratio?

Yes. Dividing both numbers by 2 turns 6:8 into 3:4, and the fraction 6/8 reduces to 3/4.

What does the Ratio to Fraction Calculator calculate?

Convert a ratio a:b to a fraction a/b. It returns Fraction.

What formula does the Ratio to Fraction Calculator use?

a : b = a/b. Direct conversion using the GCD to simplify.

What do I need to enter in the ratio to Fraction Calculator?

You enter A and B.

How is the result rounded or limited?

IEEE-754 double precision; shown to at most 6 decimal places. Whole numbers.

What are the limits of this calculator?

Whole numbers. Second value must be positive.

What is an example of a ratio to Fraction result?

With a 3 and b 4, the fraction is 3/4.

Sources

  • OpenStax, Prealgebra 2e (Rice University): fractions, decimals, percents, ratios and rounding

Content last reviewed 2026-11-04. Formulas and worked examples are checked by automated tests against independently computed values.