Calculate any missing value using the Percentage Formula
Find the Portion (Result)
Find the Base (Total)
Find the Rate (Percentage)
%
Result
–
Understanding the Base and Rate Calculator
In mathematics and business, the relationship between a whole amount, a percentage, and the resulting part is governed by a fundamental formula: Base × Rate = Portion. This calculator helps you solve for any of these three variables if you know the other two.
The Three Core Components
Base (B): The whole amount, total value, or starting quantity. This is the value that represents 100%.
Rate (R): The percentage or decimal fraction. This defines the ratio of the portion to the base.
Portion (P): The part of the base. This is the result obtained by multiplying the base by the rate.
How to Use This Calculator
1. Finding the Portion (P = B × R)
Use this mode when you know the total amount and the percentage, and you want to find the numerical value of that percentage.
Example: You are at a restaurant and the bill is 200. You want to leave a 15% tip. Base: 200 Rate: 15% Calculation: 200 × 0.15 = 30.
The portion (tip) is 30.
2. Finding the Base (B = P / R)
Use this mode when you know the partial amount and what percentage it represents, but you need to find the original total.
Example: You saved 40 on a purchase because of a 20% discount. What was the original price? Portion: 40 Rate: 20% Calculation: 40 / 0.20 = 200.
The base (original price) was 200.
3. Finding the Rate (R = P / B)
Use this mode to determine what percentage one number is of another.
Example: A student scored 45 out of 50 on a test. What is the percentage grade? Portion: 45 Base: 50 Calculation: (45 / 50) × 100 = 90%.
The rate is 90%.
Mathematical Formulas Reference
Variable to Find
Formula
Portion (P)
Base × (Rate ÷ 100)
Base (B)
Portion ÷ (Rate ÷ 100)
Rate (R)
(Portion ÷ Base) × 100
Frequently Asked Questions
Why do I divide the rate by 100?
The term "percent" literally means "per 100". In mathematical calculations, percentages must often be converted to decimal form. For example, 25% is numerically 0.25 (which is 25 divided by 100).
Can the portion be larger than the base?
Yes, if the rate is greater than 100%. For example, if a company's profit grew to 150% of last year's profit, the "portion" (this year's profit) would be larger than the "base" (last year's profit).
function updateFormLabels() {
var type = document.getElementById('calcType').value;
var label1 = document.getElementById('label1');
var label2 = document.getElementById('label2');
var suffix1 = document.getElementById('suffix1');
var suffix2 = document.getElementById('suffix2');
var input1 = document.getElementById('input1');
var input2 = document.getElementById('input2');
// Reset values for better UX when switching
input1.value = ";
input2.value = ";
document.getElementById('result-box').style.display = 'none';
if (type === 'portion') {
// Finding Portion: Needs Base and Rate
label1.innerHTML = 'Base (Total Amount)';
label2.innerHTML = 'Rate (Percentage)';
suffix1.innerHTML = ";
suffix2.innerHTML = '%';
input1.placeholder = 'e.g. 500';
input2.placeholder = 'e.g. 20';
} else if (type === 'base') {
// Finding Base: Needs Portion and Rate
label1.innerHTML = 'Portion (Partial Amount)';
label2.innerHTML = 'Rate (Percentage)';
suffix1.innerHTML = ";
suffix2.innerHTML = '%';
input1.placeholder = 'e.g. 50';
input2.placeholder = 'e.g. 10';
} else if (type === 'rate') {
// Finding Rate: Needs Portion and Base
label1.innerHTML = 'Portion (Partial Amount)';
label2.innerHTML = 'Base (Total Amount)';
suffix1.innerHTML = ";
suffix2.innerHTML = ";
input1.placeholder = 'e.g. 25';
input2.placeholder = 'e.g. 100';
}
}
function calculateResult() {
var type = document.getElementById('calcType').value;
var val1 = parseFloat(document.getElementById('input1').value);
var val2 = parseFloat(document.getElementById('input2').value);
var resultBox = document.getElementById('result-box');
var resultLabel = document.getElementById('resultLabel');
var finalResult = document.getElementById('finalResult');
var formulaUsed = document.getElementById('formulaUsed');
var explanationText = document.getElementById('explanationText');
if (isNaN(val1) || isNaN(val2)) {
alert('Please enter valid numbers in both fields.');
return;
}
var result = 0;
var formulaStr = ";
var explanation = ";
if (type === 'portion') {
// Formula: Portion = Base * (Rate/100)
// val1 = Base, val2 = Rate
result = val1 * (val2 / 100);
resultLabel.innerHTML = 'Calculated Portion';
formulaStr = val1 + ' × ' + (val2/100) + ' = ' + result;
explanation = val2 + '% of ' + val1 + ' is ' + result;
// Format result
finalResult.innerHTML = Number.isInteger(result) ? result : result.toFixed(2);
}
else if (type === 'base') {
// Formula: Base = Portion / (Rate/100)
// val1 = Portion, val2 = Rate
if (val2 === 0) {
alert('Rate cannot be zero when calculating base.');
return;
}
result = val1 / (val2 / 100);
resultLabel.innerHTML = 'Calculated Base';
formulaStr = val1 + ' ÷ ' + (val2/100) + ' = ' + result;
explanation = val1 + ' is ' + val2 + '% of ' + result;
finalResult.innerHTML = Number.isInteger(result) ? result : result.toFixed(2);
}
else if (type === 'rate') {
// Formula: Rate = (Portion / Base) * 100
// val1 = Portion, val2 = Base
if (val2 === 0) {
alert('Base cannot be zero.');
return;
}
result = (val1 / val2) * 100;
resultLabel.innerHTML = 'Calculated Rate';
formulaStr = '(' + val1 + ' ÷ ' + val2 + ') × 100 = ' + result + '%';
explanation = val1 + ' is ' + (Number.isInteger(result) ? result : result.toFixed(2)) + '% of ' + val2;
finalResult.innerHTML = (Number.isInteger(result) ? result : result.toFixed(2)) + '%';
}
formulaUsed.innerHTML = 'Formula: ' + formulaStr;
explanationText.innerHTML = explanation;
resultBox.style.display = 'block';
}
// Initialize labels on load
updateFormLabels();