Fraction Calculator API
Add, subtract, multiply or divide fractions, mixed numbers and decimals exactly, with the simplified result, mixed number, decimal and worked steps.
POST /api/v1/tools/fraction-calculatorMCP fraction_calculatorCalculatorsAdd, subtract, multiply and divide fractions and mixed numbers. Get the simplified answer as a fraction, mixed number and decimal, with every step shown.
Input
Send these as a JSON object. Unknown fields are rejected.
- a
- First number: a fraction ("3/4"), mixed number ("1 1/2"), whole number ("-2") or decimal ("0.75"). (string, up to 60 characters, required)
- operation
- The operation to apply: a <op> b. (string, one of add, subtract, multiply, divide, required)
- b
- Second number, in the same forms as a. (string, up to 60 characters, required)
curl https://pithlab.com/api/v1/tools/fraction-calculator \n -H "Authorization: Bearer $PITHLAB_KEY" \n -H "Content-Type: application/json" \n -d '{"a":"1 1/2","operation":"add","b":"3/4"}'Example response
{
"ok": true,
"result": {
"fraction": "9/4",
"mixed": "2 1/4",
"decimal": {
"exact": true,
"repeating": "2.25",
"approx": "2.25"
},
"steps": [
"Convert the mixed number: 1 1/2 = 3/2",
"Use the lowest common denominator 4: 3/2 = 6/4",
"Add the numerators: 6/4 + 3/4 = 9/4",
"As a mixed number: 9/4 = 2 1/4"
],
"text": "1 1/2 + 3/4 = 9/4 = 2 1/4 = 2.25"
}
}