Percentage Calculator
This percentage calculator answers three questions: the difference between two values, marks earned as a share of a total, and a price after a discount. Pick a mode in the dropdown, enter two non-negative numbers, and the result line shows the answer with the formula explained below.
Choose a percentage calculation
The stacked bar and the donut show your part against the whole; both are redrawn from the two numbers on every calculation.
Percentage difference
For non-negative a and b, use |a − b| / ((a + b) / 2) × 100. Values 80 and 100 give 22.22% in either order. This formula differs from change relative to a starting value.
Marks and discounts
42 marks out of 50 is 84.00%. A 25% discount on a price of 80 gives a price of 60.00 and savings of 20.00. Values are rounded only at final display.
Choosing a mode
The form has one dropdown and two number fields. Percentage difference compares two values and labels them First value and Second value. Percentage of marks renames the fields to Marks earned and Total marks. Discounted price renames them to Original price and Discount (%). When you switch the dropdown, the field labels and the rule line under the form change to match the selected mode, then you press Calculate percentage to see the answer. Each mode reads the same two fields but applies a different formula, so choose the mode that matches your question before entering numbers.
Three bases, three answers
Every percent answer needs a base, meaning the value you divide by. Percentage difference divides the absolute gap by the average of the two inputs, so 80 and 100 give the same result in either order: 20 divided by 90, times 100, is 22.22%. Percentage of marks divides by the total, so the base is the second field and order matters: 42 out of 50 is 84.00%, while 50 out of 42 is rejected because earned marks cannot exceed the total. Discounted price applies the discount to the original price, so the base is the price itself. State which base you mean whenever you quote a percent.
Input format and limits
Each field accepts one decimal number: up to 100 characters, digits with a dot for the fraction part, and no commas, currency symbols, or exponent notation such as 1e3. Values below zero are rejected with a message asking for zero or greater. Mode-specific limits also apply. In percentage difference, both values cannot be zero because the average sits in the denominator. In percentage of marks, the total must be greater than zero and the earned marks must not exceed it. In discounted price, the discount must be between 0 and 100. The field that fails shows the message and takes focus, so you can correct it and submit again.
Rounding and displayed results
Inputs are parsed as decimals and processed with integer arithmetic on exact fractions, so intermediate steps keep full precision. Only the final display rounds, to two decimal places, and it rounds halves up. Values 1 and 2 in percentage difference give 1 divided by 1.5 times 100, which displays as 66.67%. Ten marks out of 30 give 33.33%. A price of 20 with a 15 percent discount displays 17.00 with savings of 3.00. The percent sign appears on difference and marks results; the discount result shows plain numbers because no currency is attached, and the same figures read in any currency you keep in mind.
Questions this page does not cover
Two common questions sit outside the three modes here. Directional change, such as a value rising from 80 to 100, is 25 percent relative to the starting value, and no mode returns that number; the difference mode answers on the average base instead. A question like what is 30 percent of a number has no dedicated mode either, although the discount mode savings line computes exactly that: enter the number as the original price and 30 as the discount, then read the savings value. For rounding an answer to fewer digits, the rounding calculator on this site is the adjacent tool.
What each mode asks for
The two input boxes keep their labels, but each mode reads them differently. Percentage difference treats both boxes as plain values and divides the gap by their average, so 80 and 100 give 22.22% whichever way you enter them; it only refuses when both are zero. Percentage of marks reads the first box as the score you earned and the second as the total, and rejects a total of zero or an earned value above the total. Discounted price reads the first box as the original price and the second as the discount percent, which must not exceed 100. The message appears on the box that failed, so you know which one to fix.
Frequently asked questions
What calculations does this percentage calculator include?
Three modes in one form: percentage difference between two non-negative values, percentage of marks earned out of a total, and a discounted price with the money saved. Pick the mode in the dropdown, enter the two numbers it asks for, and submit. Each mode shows its own field labels, rule text, and result format.
What is the difference between percentage difference and percentage change?
Percentage difference is symmetric: it divides the absolute gap by the average of the two values, so 80 and 100 give 22.22 percent in either order. Percentage change is directional and divides by the starting value, so a move from 80 to 100 is 25 percent on that base. This page implements only the first formula, not the second.
How do I find what one number is as a percent of another?
Use percentage of marks. Enter the part as Marks earned and the whole as Total marks. The base is always the total, so the total must be greater than zero and the part cannot exceed it. For example, 42 out of 50 returns 84.00%. Swapping the two values on the same pair is rejected rather than answered.
How do I calculate a sale price and the money saved?
Use discounted price. Enter the original price and a discount between 0 and 100. A price of 80 with a 25 percent discount returns a discounted price of 60.00 and savings of 20.00. The result carries no currency symbol, so both numbers are in whatever unit you enter as the price, and the base for the discount is that original price.
Why do I see a message instead of a result?
Common causes: a blank or over-long field above 100 characters, a comma, currency symbol, or exponent inside a number, a negative value, a zero total in marks mode, earned marks above the total, both values zero in difference mode, or a discount above 100. Each message names the field at fault, and focus moves to it so you can correct the input and submit again.
Does the tool round numbers during the calculation?
No. Each formula runs on exact fractions built from the digits you typed, and rounding happens once, on the final displayed value, to two decimal places with halves rounded up. That is why values 1 and 2 in difference mode display 66.67% instead of a truncated 66.66%.