Quickly calculate a specific amount based on a percentage of a total value, or determine what percentage one number is of another.
1. Find the Amount (Value)
Example: What is 15% of 200?
2. Find the Percentage (%)
Example: What percentage is 30 of 150?
How to Calculate Amount in Percentage
Understanding how to calculate amounts in percentage is a fundamental skill used in everything from shopping and taxes to scientific data analysis. A percentage essentially represents a fraction of 100.
The Basic Formula for Amount
To find a specific amount when you have the percentage and the total, you use the following formula:
Amount = (Percentage / 100) × Total Value
Step-by-Step Calculation Guide
Identify the numbers: Determine your "Whole" (the total amount) and your "Rate" (the percentage).
Convert the percentage: Divide the percentage by 100 to turn it into a decimal (e.g., 20% becomes 0.20).
Multiply: Multiply that decimal by the total value to find the resulting amount.
Real-World Examples
Sales Tax: If an item costs 50 and the tax is 8%, the tax amount is (8 / 100) × 50 = 4.
Discounts: A 25% discount on a 120 jacket means you save (25 / 100) × 120 = 30.
Tips: An 18% tip on a 60 restaurant bill is (18 / 100) × 60 = 10.80.
Calculating the Percentage (%) of Two Numbers
If you have two numbers and want to know what percentage one is of the other, use this formula:
Percentage = (Part / Total) × 100
For instance, if you scored 45 out of 50 on a test: (45 / 50) = 0.9. Multiply by 100 to get 90%.
function calculateAmountFromPercent() {
var total = parseFloat(document.getElementById('calc1_total').value);
var percent = parseFloat(document.getElementById('calc1_percent').value);
var resultDiv = document.getElementById('result1');
if (isNaN(total) || isNaN(percent)) {
resultDiv.style.display = 'block';
resultDiv.style.color = '#e74c3c';
resultDiv.style.background = '#fdedec';
resultDiv.innerHTML = 'Please enter valid numeric values.';
return;
}
var finalAmount = (percent / 100) * total;
// Limit to 2 decimal places for cleaner output
var formattedResult = Number.isInteger(finalAmount) ? finalAmount : finalAmount.toFixed(2);
resultDiv.style.display = 'block';
resultDiv.style.color = '#2980b9';
resultDiv.style.background = '#e8f4fd';
resultDiv.innerHTML = percent + '% of ' + total + ' is ' + formattedResult;
}
function calculatePercentFromAmount() {
var part = parseFloat(document.getElementById('calc2_part').value);
var total = parseFloat(document.getElementById('calc2_total').value);
var resultDiv = document.getElementById('result2');
if (isNaN(part) || isNaN(total)) {
resultDiv.style.display = 'block';
resultDiv.style.color = '#e74c3c';
resultDiv.style.background = '#fdedec';
resultDiv.innerHTML = 'Please enter valid numeric values.';
return;
}
if (total === 0) {
resultDiv.style.display = 'block';
resultDiv.style.color = '#e74c3c';
resultDiv.style.background = '#fdedec';
resultDiv.innerHTML = 'Total value cannot be zero.';
return;
}
var finalPercent = (part / total) * 100;
var formattedResult = Number.isInteger(finalPercent) ? finalPercent : finalPercent.toFixed(2);
resultDiv.style.display = 'block';
resultDiv.style.color = '#27ae60';
resultDiv.style.background = '#eafaf1';
resultDiv.innerHTML = part + ' is ' + formattedResult + '% of ' + total;
}