Bookmarks    
nPr and nCr    
Random Number    
SD Calculator    
Sample Size    
Percent Error    
Density    
Molarity    
Molar Mass    
Ohm's Law    
Watts to Amps    
Voltage Drop    
Long Division    
Mixed Numbers    
Rounding    
Nth Root    
Exponents    
Half-Life    
Polar Form    
De Moivre    
3D Distance    
Point to Line    
Cross Product    
Determinant    
Sin Cos Tan    
Triangle Area    
Scale Factor    
Sector Area    
Ellipse Area    
Cube Volume    
Box Volume    
Sphere Volume    
Cone Volume    
Pipe Volume    
Time Duration    
Time Card    
Present Value    
Future Value    
Churn Rate    
A/B Test Calc    
SEO Traffic    
Ideal Weight    
Fat Intake    
Child Height    
Golf Handicap    
Heat Index    
Wind Chill    
Dew Point    
Download Time    
kWh to Cost    
AC Size (BTU)    
Heating Costs    
LED Savings    
Trip Gas Cost    
Tire Size    
Solar Output    
Solar Payback    
Battery Size    
Wall Area    
Gravel Needed    
Mortar Mix    
Slope Grade    
Curtain Size    
Soil Needed    
Sod Needed    
Ramp Length    
Blind Size    
Drain Slope    
Board Feet    
Heat Loss    
Furniture Fit    
Moving Boxes    
Plywood Cuts    
Shelf Sag    
   Add
Probability and random number calculators
Independent Events
Independent Events
Two Events Solver
Two Events Solver
Repeated Trials
Repeated Trials
Bayes' Theorem
Bayes' Theorem
Expected Value
Expected Value
Binomial Distribution
Binomial Distribution
nPr and nCr
nPr and nCr
Circular Permutation
Circular Permutation
With Repetition
With Repetition
Random Number
Random Number
Averages and statistics calculators
Average Calculator
Average Calculator
Mean Median Mode
Mean Median Mode
SD Calculator
SD Calculator
Quartiles & IQR
Quartiles & IQR
Frequency Table
Frequency Table
Correlation (r)
Correlation (r)
Normal Probability
Normal Probability
Z-Score Calculator
Z-Score Calculator
Confidence Interval
Confidence Interval
Sample Size
Sample Size
Mark & Recapture
Mark & Recapture
P-Value Calculator
P-Value Calculator
Percentage and ratio calculators
Percentage Calc
Percentage Calc
Percent Change
Percent Change
Percent Difference
Percent Difference
Percent Error
Percent Error
Ratio Calculator
Ratio Calculator
Discount Calculator
Discount Calculator
Sales Tax Calculator
Sales Tax Calculator
Margin Calculator
Margin Calculator
Speed calculators
Speed Calculator
Speed Calculator
Density and concentration calculators
Density
Density
Molarity
Molarity
Molar Mass
Molar Mass
Physics and electricity calculators
Ohm's Law
Ohm's Law
Watts to Amps
Watts to Amps
Resistor Colors
Resistor Colors
Voltage Drop
Voltage Drop
Unit conversion calculators
Weight Converter
Weight Converter
Shoe Size Converter
Shoe Size Converter
Integer and signed number calculators
Long Division
Long Division
LCM Calculator
LCM Calculator
GCF Calculator
GCF Calculator
Integer Calculator
Integer Calculator
Prime Factorization
Prime Factorization
Diophantine Solver
Diophantine Solver
Modulo Calculator
Modulo Calculator
Factor Calculator
Factor Calculator
Roman Numerals
Roman Numerals
Fraction, decimal and rounding calculators
Fraction Calculator
Fraction Calculator
Mixed Numbers
Mixed Numbers
Simplify Fractions
Simplify Fractions
Fraction to Decimal
Fraction to Decimal
Decimal to Fraction
Decimal to Fraction
Rounding
Rounding
Equation and inequality calculators
Linear Equation
Linear Equation
Linear Systems
Linear Systems
Quadratic Formula
Quadratic Formula
Absolute Value
Absolute Value
Quadratic Inequality
Quadratic Inequality
Polynomial calculators
Binomial Theorem
Binomial Theorem
Square root and nth root calculators
Simplify Radicals
Simplify Radicals
Nth Root
Nth Root
Exponent and logarithm calculators
Exponents
Exponents
Log Calculator
Log Calculator
Number of Digits
Number of Digits
Scientific Notation
Scientific Notation
Sci. Notation Math
Sci. Notation Math
Half-Life
Half-Life
Complex number calculators
Complex Numbers
Complex Numbers
Polar Form
Polar Form
De Moivre
De Moivre
Function and graph calculators
Slope Calculator
Slope Calculator
Linear Function
Linear Function
Direct & Inverse Variation
Direct & Inverse Variation
y = ax² Calculator
y = ax² Calculator
Distance Formula
Distance Formula
3D Distance
3D Distance
Section Formula
Section Formula
Point to Line
Point to Line
Lat/Long Distance
Lat/Long Distance
Complete the Square
Complete the Square
Circle Equation
Circle Equation
Conic Sections
Conic Sections
Polar Coordinates
Polar Coordinates
Sequence calculators
Arithmetic Sequence
Arithmetic Sequence
Geometric Sequence
Geometric Sequence
Fibonacci Sequence
Fibonacci Sequence
Recurrence Relation
Recurrence Relation
Vector calculators
Vector Calculator
Vector Calculator
Cross Product
Cross Product
Matrix calculators
Matrix Calculator
Matrix Calculator
Determinant
Determinant
Inverse Matrix
Inverse Matrix
Plane geometry calculators
Sin Cos Tan
Sin Cos Tan
Degrees ⇔ Radians
Degrees ⇔ Radians
a sin θ + b cos θ
a sin θ + b cos θ
Triangle Solver
Triangle Solver
Triangle Area
Triangle Area
Right Triangle
Right Triangle
Pythagorean Theorem
Pythagorean Theorem
Polygon Angles
Polygon Angles
Scale Factor
Scale Factor
Parallel Lines
Parallel Lines
Rectangle Area
Rectangle Area
Parallelogram Area
Parallelogram Area
Trapezoid Area
Trapezoid Area
Circle Calculator
Circle Calculator
Sector Area
Sector Area
Inscribed Angle
Inscribed Angle
Ellipse Area
Ellipse Area
Solid geometry calculators
Cube Volume
Cube Volume
Cube Surface Area
Cube Surface Area
Box Volume
Box Volume
Box Surface Area
Box Surface Area
Cylinder Volume
Cylinder Volume
Cylinder Surface
Cylinder Surface
Sphere Volume
Sphere Volume
Sphere Surface
Sphere Surface
Spherical Cap Volume
Spherical Cap Volume
Cap Surface Area
Cap Surface Area
Ellipsoid Volume
Ellipsoid Volume
Ellipsoid Surface
Ellipsoid Surface
Pyramid Volume
Pyramid Volume
Pyramid Surface
Pyramid Surface
Cone Volume
Cone Volume
Cone Surface Area
Cone Surface Area
Frustum Volume
Frustum Volume
Frustum Surface Area
Frustum Surface Area
Pipe Volume
Pipe Volume
Capsule Volume
Capsule Volume
Capsule Surface Area
Capsule Surface Area
Date and time calculators
Age Calculator
Age Calculator
Days Between Dates
Days Between Dates
Date Calculator
Date Calculator
Hours From Now
Hours From Now
Day of the Week
Day of the Week
Time Calculator
Time Calculator
Time Zone Converter
Time Zone Converter
Hours Calculator
Hours Calculator
Time Duration
Time Duration
Time Card
Time Card
Finance and economics calculators
Compound Interest
Compound Interest
Simple Interest
Simple Interest
Interest Calculator
Interest Calculator
TVM Calculator
TVM Calculator
Present Value
Present Value
Future Value
Future Value
ROI Calculator
ROI Calculator
IRR Calculator
IRR Calculator
Payback Period
Payback Period
Average Return
Average Return
GDP Calculator
GDP Calculator
Web marketing and ad metric calculators
CTR Calculator
CTR Calculator
Conversion Rate
Conversion Rate
CPC, CPM & CPA
CPC, CPM & CPA
ROAS Calculator
ROAS Calculator
Break-Even CPA
Break-Even CPA
LTV Calculator
LTV Calculator
CAC Calculator
CAC Calculator
Churn Rate
Churn Rate
A/B Test Calc
A/B Test Calc
A/B Sample Size
A/B Sample Size
SEO Traffic
SEO Traffic
Break-Even Point
Break-Even Point
Markup vs. Margin
Markup vs. Margin
CAGR Calculator
CAGR Calculator
Health and fitness calculators
BMI Calculator
BMI Calculator
Sleep Calculator
Sleep Calculator
Calorie Calculator
Calorie Calculator
BMR Calculator
BMR Calculator
TDEE Calculator
TDEE Calculator
Ideal Weight
Ideal Weight
Body Fat Calculator
Body Fat Calculator
Lean Body Mass
Lean Body Mass
Calories Burned
Calories Burned
Protein Intake
Protein Intake
Macro Calculator
Macro Calculator
Carb Calculator
Carb Calculator
Fat Intake
Fat Intake
Child Height
Child Height
Sports calculators
Golf Handicap
Golf Handicap
Pace Calculator
Pace Calculator
1RM Calculator
1RM Calculator
Target Heart Rate
Target Heart Rate
Weather calculators
Heat Index
Heat Index
Wind Chill
Wind Chill
Dew Point
Dew Point
Computer calculators
Base Converter
Base Converter
Subnet Calculator
Subnet Calculator
Download Time
Download Time
Household energy and budget calculators
Electricity Cost
Electricity Cost
kWh to Cost
kWh to Cost
Yearly kWh to Cost
Yearly kWh to Cost
AC Size (BTU)
AC Size (BTU)
AC Running Cost
AC Running Cost
Heating Costs
Heating Costs
Gas vs Electric
Gas vs Electric
LED Savings
LED Savings
Salary Calculator
Salary Calculator
Budget Calculator
Budget Calculator
Car calculators
Trip Gas Cost
Trip Gas Cost
EV Charging Cost
EV Charging Cost
EV vs Gas Cost
EV vs Gas Cost
MPG Calculator
MPG Calculator
Tire Size
Tire Size
Solar power and battery calculators
Solar Output
Solar Output
Solar Panel Count
Solar Panel Count
Solar Payback
Solar Payback
Battery Size
Battery Size
Home and DIY calculators
Tile Calculator
Tile Calculator
Stair Calculator
Stair Calculator
Concrete Volume
Concrete Volume
Wall Area
Wall Area
Wallpaper Rolls
Wallpaper Rolls
Paint Calculator
Paint Calculator
Flooring Needed
Flooring Needed
Exterior Walls
Exterior Walls
Gravel Needed
Gravel Needed
Mortar Mix
Mortar Mix
Slope Grade
Slope Grade
Lumber Cut List
Lumber Cut List
Lot Coverage/FAR
Lot Coverage/FAR
Sheet Vinyl Roll
Sheet Vinyl Roll
Insulation Needed
Insulation Needed
Curtain Size
Curtain Size
TV Size & Distance
TV Size & Distance
Soil Needed
Soil Needed
Sod Needed
Sod Needed
Block Calculator
Block Calculator
Brick Calculator
Brick Calculator
Deck Materials
Deck Materials
Ramp Length
Ramp Length
Pilot Hole Size
Pilot Hole Size
Room Ventilation
Room Ventilation
Paint Thinning
Paint Thinning
Baseboard & Trim
Baseboard & Trim
Blind Size
Blind Size
Picture Hanging
Picture Hanging
Drain Slope
Drain Slope
Screw Calculator
Screw Calculator
Board Feet
Board Feet
Fence Calculator
Fence Calculator
Wood Shrinkage
Wood Shrinkage
Caulk Calculator
Caulk Calculator
Heat Loss
Heat Loss
Furniture Fit
Furniture Fit
Moving Boxes
Moving Boxes
Storage Capacity
Storage Capacity
Plywood Cuts
Plywood Cuts
Shelf Sag
Shelf Sag

Percent Error Calculator (Absolute and Relative Error)

Enter the measured value (the value you actually got in an experiment or measurement) and the true value (the value accepted as correct), and press "Calculate". The percent error, error, absolute error and relative error are calculated together.

The percent error is shown with a sign (plus if the measured value is larger than the true value, minus if it is smaller). The true value cannot be 0.
Result and graph
Enter the measured value and the true value in the fields on the left and press "Calculate". The result and a graph will appear here.

What you can do on this page

  • Enter just two values, the measured value and the true value, and get all four results at once - percent error, error, absolute error and relative error
  • Use it as is to check the accuracy of a science experiment or measurement, such as "I measured the boiling point of water as 98.6 °C. How many percent off is that from the true value of 100 °C?"
  • The percent error is shown with a sign. A plus shows at a glance that you measured higher than the true value, and a minus that you measured lower
  • Along with the result, a graph shows where the gap (the error) between the measured value and the true value lies
  • A plain-language explanation of the formulas and copy-and-paste formulas for Excel, Google Sheets and Python are all on this page
When the true value is 0, the percent error and relative error cannot be calculated (it would mean dividing by 0). In that case, compare using the absolute error (the size of the gap itself).

What is this calculation used for?

Judging the accuracy of a measurement in a lab report (school)

You measure the boiling point of water as 98.6 °C. Compared with the true value of 100 °C, the percent error is \((98.6 - 100) \div 100 \times 100 = -1.4\%\) (1.4% lower).
In a middle or high school lab report, going beyond the raw result to discuss how many percent you were off and why makes a big difference to your grade. Percent error is the standard lab report calculation that starts that discussion.

Dimension checks and quality control (manufacturing)

A part is designed to be 2.000 in long and measures 1.996 in. With the design value as the reference, the percent error is \((1.996 - 2.000) \div 2.000 \times 100 = -0.2\%\).
Factories inspect parts against a tolerance, such as "pass if within some percent (or some thousandths of an inch) of the design value". Tracking errors as percents lets you compare the precision of parts of different sizes on the same scale (in this example the design value takes the place of the true value).

Checking the accuracy of a sales or demand forecast (work and business)

If you forecast "we will sell 110 units next month" and actually sell 100, the forecast's percent error against the actual result is \((110 - 100) \div 100 \times 100 = +10\%\) (10% too high).
In retail and manufacturing, teams check the percent error between forecast and actual every month to improve how they forecast. A run of pluses tends to leave extra stock, and a run of minuses tends to lead to running out. Because the percent error has a sign, it even shows the habit behind your estimates.

Checking how accurate a scale or measuring tool is (home and lab prep)

If you put a 100 g calibration weight on a kitchen scale and it reads 99 g, the percent error is \((99 - 100) \div 100 \times 100 = -1\%\).
Measuring something whose correct value you know tells you how far you can trust the tool. Comparing your result with the tool's stated accuracy (for example, ±1%) is a useful check for lab prep, cooking and health tracking.

Testing your mental math and estimates (estimation practice)

You estimate the items in your cart at "about $15" in your head, and the actual total at checkout is $14.80. The percent error is \((15 - 14.80) \div 14.80 \times 100 \approx +1.35\%\).
In estimation and Fermi problem practice, you measure your skill by how many percent you were off. Once your percent error stays within a few percent, that sense for numbers pays off in many places, from work estimates to managing a household budget.

Formulas and figures

Formula for the percent error (%)
Figure
Standard notation (the usual math form)
\(E\) \(=\) \((\) \(A\) \(-\) \(T\) \()\) \(\div\) \(T\) \(\times\) \(100\)
In words (symbols replaced with words)
⑤ \(E\): percent error (%) \(=\) \((\) ① \(A\): measured value \(-\) ② \(T\): true value \()\) \(\div\) ③ \(T\): true value \(\times\) ④ \(100\): per hundred
The formula in words
① From the \(A\): measured value
② subtract the \(T\): true value to get the error
③ divide that by the \(T\): true value to get it as a rate
④ multiply it by \(100\): per hundred to turn it into a percent
⑤ and you get the \(E\): percent error (%)
Quick example
A thermometer shows the boiling point of water as 98.6 °C. The percent error compared with the true value of 100 °C is
\(E\): percent error (%) \(=\) \((\) measured value (98.6 °C) \(-\) true value (100 °C) \()\) \(\div\) true value (100 °C) \(\times\) per hundred (100)
\(98.6 - 100 = -1.4\)
\(-1.4 \div 100 = -0.014\)
\(-0.014 \times 100 = -1.4\ \ (-1.4\%)\)
Key idea
The sign of the answer shows the direction of the gap. A minus says you measured lower than the true value (\(-1.4\)% is 1.4% lower), and a plus says you measured higher. The closer the percent error is to 0, the more accurate the measurement. Always divide by the true value. The same gap of 1.4 is 1.4% of a true value of 100 but 14% of a true value of 10, because the percent error shows how far off you are compared with the true value. Many US science textbooks define percent error with absolute value bars, \(|A - T| \div T \times 100\), so that it is always positive and shows only the size of the gap (1.4% in this example). The calculator on this page keeps the sign so you can also see the direction. Drop the sign if your class uses the positive version.
Formula for the absolute error
Figure
Standard notation (the usual math form)
\(D\) \(=\) \(|\) \(A\) \(-\) \(T\) \(|\)
In words (symbols replaced with words)
④ \(D\): absolute error \(=\) ③ \(|\) ① \(A\): measured value \(-\) ② \(T\): true value \(|\)
The formula in words
① From the \(A\): measured value
② subtract the \(T\): true value to get the error
③ remove any minus sign with the absolute value bars | | so only the size of the gap is left
④ and you get the \(D\): absolute error
Quick example
The absolute error between the measured boiling point of 98.6 °C and the true value of 100 °C is
\(D\): absolute error \(=\) \(|\) measured value (98.6 °C) \(-\) true value (100 °C) \(|\)
\(98.6 - 100 = -1.4\)
\(| -1.4 | = 1.4\)
Key idea
The absolute error is how far off you actually were, in the real units such as °C or grams. The direction does not matter, so the absolute value removes the minus sign. The absolute error alone cannot tell you whether a measurement is good. The same absolute error of 1.4 is a small gap for a true value of 100 but a large gap for a true value of 2. That is why you judge it with the relative error (next) or the percent error, which compare the gap with the true value.
Formula for the relative error
Figure
Standard notation (the usual math form)
\(R\) \(=\) \(D\) \(\div\) \(|T|\)
In words (symbols replaced with words)
③ \(R\): relative error \(=\) ① \(D\): absolute error \(\div\) ② \(|T|\): size of the true value
The formula in words
① Take the \(D\): absolute error
② divide it by the \(|T|\): size of the true value
③ and you get the \(R\): relative error
Quick example
From the absolute error of 1.4 °C and the true boiling point of 100 °C, the relative error is
\(R\): relative error \(=\) absolute error (1.4 °C) \(\div\) size of the true value (100 °C)
\(1.4 \div 100 = 0.014\)
Key idea
The relative error shows how far off you were compared with the true value, as a decimal rate. Multiply it by 100 and you get a percent that matches the size of the percent error (the percent error without its sign): \(0.014 \times 100 = 1.4\)%. We divide by \(|T|\) (the absolute value of the true value) so that we always divide by a size, even when the true value is negative. If the true value is positive, it is the same as dividing by \(T\). Look at the units: the absolute error has units such as °C or grams, but the relative error is a rate with no units. Only the unitless relative error and percent error let you compare the accuracy of measurements in different units (for example, a temperature measurement and a weight measurement).
Error calculations start from "error = measured value − true value". Divide the error by the true value and multiply by 100 to get the signed percent error (%), where the sign shows the direction of the gap (plus = measured higher, minus = measured lower). To look at only the size of the gap, use the absolute error (|measured value − true value|) and the relative error (absolute error ÷ |true value|).

Symbols and terms

Symbols

\(A\) A The measured value, the value you actually got in an experiment or measurement. It is the 98.6 °C in "I measured the boiling point of water as 98.6 °C".
\(T\) T The true value, the value accepted as correct, such as a theoretical value or a value from a reference book. It is the 100 °C in "water boils at 100 °C at 1 atm".
\(A - T\) A minus T The error. It shows how far the measured value is from the true value, with a sign and in the real units. A minus shows that you measured lower than the true value.
\(E\) E The percent error: the error divided by the true value, multiplied by 100 and written as a percent. On this page it has a sign, and \(-1.4\) says "1.4% lower than the true value".
\(D\) D The absolute error, the absolute value of the error (|measured value − true value|). It shows only the size of the gap, in the real units, whatever its direction.
\(R\) R The relative error, the absolute error divided by the size of the true value. It is a rate with no units. Multiply it by 100 to get the size of the percent error (0.014 → 1.4%).
\(|\ |\) absolute value bars The absolute value sign. It gives the size of the number inside with its sign removed. Example - \(|-1.4| = 1.4\) and \(|1.4| = 1.4\).
\(\%\) percent The percent sign. It shows how many out of 100. The word comes from the Latin per centum, "for each hundred".

Terms

error The gap between the measured value and the true value. In science it is normally defined as "error = measured value − true value". No instrument, however precise, can bring the error all the way to 0, so estimating the size of the error is an important part of measuring.
true value (accepted value) The value a quantity really has. In real measurements the true value itself is often unknown, so a theoretical value, a value from an official reference or a value from a more precise measurement is used in its place to judge the error. US textbooks often call it the accepted value or the theoretical value.
measured value (observed value) The value you actually got in an experiment, observation or measurement. It is also called the observed value or the experimental value.
percent error How many percent of the true value the error is. It is also called the percentage error. Written with a sign it also shows the direction of the gap; written as an absolute value it shows only the size.
absolute error The absolute value of the error. It shows the size of the gap in the real units such as °C, grams or inches. Keep in mind that you cannot judge a measurement without comparing this with the size of the true value.
relative error The absolute error divided by the size of the true value. It has no units, so it lets you compare the accuracy of different kinds of measurements (such as temperature and weight). Multiply it by 100 to show it as a percent (the size of the percent error).
absolute value The distance from 0 on the number line. For a negative number, it is the number with the minus sign removed (example - \(|-1.4| = 1.4\)). It is taught in Grade 6 in US schools.
percent A rate written with the base counted as 100. The sign is %. Multiply a decimal rate by 100 to get the percent (0.014 → 1.4%).

Good to know before you start

Here is what helps you use the calculation on this page with real understanding, not just by pressing the button.
If you get stuck, going back over these topics is the quickest way forward.

Rates and percents (Grade 6)
  • Understanding the relation "part ÷ whole = rate" (for percent error, the true value is the whole)
  • Being able to switch between a decimal and a percent, as with 0.014 and 1.4% (multiply by 100 to get a percent)
Positive and negative numbers (Grades 6–7)
  • Being able to do a subtraction with a negative answer, such as \(98.6 - 100 = -1.4\)
  • Knowing that a negative number can show "smaller than the reference" or "short of it"
Absolute value (Grade 6)
  • Knowing that the absolute value is the size of a number with its sign removed (example - \(|-1.4| = 1.4\))
Multiplying and dividing decimals (Grades 5–6)
  • Being able to multiply and divide decimals by 100, as in \(1.4 \div 100\) and \(0.014 \times 100\)
  • Having a feel that dividing by 100 moves the decimal point two places left, and multiplying by 100 moves it two places right

How to calculate it in Excel

Copy the whole table below and paste it into cell A1 in Excel. It works as is.
Table to find the percent error (measured boiling point 98.6 °C, true value 100 °C)
Measured value 98.6
True value 100
Percent error (%) =(B1-B2)/B2*100
Table to find the absolute error (same example)
Measured value 98.6
True value 100
Absolute error =ABS(B1-B2)
Table to find the relative error (same example)
Measured value 98.6
True value 100
Relative error =ABS(B1-B2)/ABS(B2)
After pasting, B1 and B2 are your inputs and B3 is calculated automatically.
"B1" and "B2" in a formula tell Excel to use the number in that cell. "*" is multiplication, "/" is division and "ABS( )" is the absolute value function (it removes a minus sign).
For example, B3 shows -1.4 in the first table (1.4% lower than the true value), 1.4 in the second and 0.014 in the third. Just replace B1 and B2 with your own numbers.

How to calculate it in Google Sheets

Copy the whole table below and paste it into cell A1 in Google Sheets. It works as is.
Table to find the percent error (measured boiling point 98.6 °C, true value 100 °C)
Measured value 98.6
True value 100
Percent error (%) =(B1-B2)/B2*100
Table to find the absolute error (same example)
Measured value 98.6
True value 100
Absolute error =ABS(B1-B2)
Table to find the relative error (same example)
Measured value 98.6
True value 100
Relative error =ABS(B1-B2)/ABS(B2)
The same formulas as in Excel (including the ABS function) work as is. Copy the whole table, paste it into cell A1, and replace B1 and B2 with your own numbers.

How to calculate it in Python

# Find the percent error, absolute error and relative error (length of a part: measured 48 mm, true 50 mm)
observed = 48      # measured value
true_value = 50    # true value
error = observed - true_value                        # error (with sign)
percent_error = error / true_value * 100             # percent error (%, with sign)
absolute_error = abs(error)                          # absolute error
relative_error = abs(error) / abs(true_value)        # relative error
print(f"Error = {error}")
print(f"Percent error = {percent_error}%")
print(f"Absolute error = {absolute_error}")
print(f"Relative error = {relative_error}")
Runs with the standard library only. abs( ) is the absolute value function (it removes a minus sign). Change the two numbers, observed (the measured value) and true_value (the true value), and run it. This example prints an error of -2, a percent error of -4.0%, an absolute error of 2 and a relative error of 0.04.

How to write it in LaTeX and other math languages (copy and paste)

Formula for the percent error (%)
E = (A − T) ÷ T × 100
E = \frac{A - T}{T} \times 100
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
  <mrow>
    <mi>E</mi>
    <mo>=</mo>
    <mfrac>
      <mrow><mi>A</mi><mo>&#x2212;</mo><mi>T</mi></mrow>
      <mi>T</mi>
    </mfrac>
    <mo>&#xD7;</mo>
    <mn>100</mn>
  </mrow>
</math>
E = (A - T)/T xx 100
(observed - truevalue)/truevalue*100
percenterror := (observed - truevalue)/truevalue*100;
percent_error = (observed - truevalue)/truevalue*100;
E = (A - T)/T × 100
Formula for the absolute error
D = |A − T|
D = \left| A - T \right|
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
  <mrow>
    <mi>D</mi>
    <mo>=</mo>
    <mrow>
      <mo>|</mo>
      <mi>A</mi>
      <mo>&#x2212;</mo>
      <mi>T</mi>
      <mo>|</mo>
    </mrow>
  </mrow>
</math>
D = |A - T|
Abs[observed - truevalue]
abserror := abs(observed - truevalue);
abs_error = abs(observed - truevalue);
D = |A - T|
Formula for the relative error
R = |A − T| ÷ |T|
R = \frac{\left| A - T \right|}{\left| T \right|}
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
  <mrow>
    <mi>R</mi>
    <mo>=</mo>
    <mfrac>
      <mrow>
        <mo>|</mo>
        <mi>A</mi>
        <mo>&#x2212;</mo>
        <mi>T</mi>
        <mo>|</mo>
      </mrow>
      <mrow>
        <mo>|</mo>
        <mi>T</mi>
        <mo>|</mo>
      </mrow>
    </mfrac>
  </mrow>
</math>
R = |A - T|/|T|
Abs[observed - truevalue]/Abs[truevalue]
relerror := abs(observed - truevalue)/abs(truevalue);
rel_error = abs(observed - truevalue)/abs(truevalue);
R = |A - T|/|T|

How to have ChatGPT  do the calculation

You are a calculation assistant for percent error. Do the following calculations by actually running Python code, and base your answer only on the numbers from the execution result (do not answer by mental math or guessing). Find the percent error with its sign ((measured value − true value) ÷ true value × 100).

1. The percent error when the measured value is 98.6 and the true value is 100
2. The percent error, absolute error and relative error when the measured value is 10 and the true value is 11
3. The percent error when the measured value is 123.456 and the true value is 100

Show the formulas you used and the numbers from the execution result.

How to Use
  1. 1
    Enter your numbers
    Type the numbers you want to calculate with into the input fields
  2. 2
    Calculate
    Press the "Calculate" button
  3. 3
    Check the result
    The result appears on the spot. The same page also explains the idea behind the calculation and the formula
  DataChef Features
Easy and Free
Unlimited conversions for free.
No technical knowledge required.
Intuitive and user-friendly operation.
No Registration Required
Available immediately after access.
Can be used without registering personal information.
Safe and Secure
Fully SSL encrypted communication.
Automatic file deletion by clicking "download".
Fast
High-speed site access
and rapid file conversion.
No Watermark
No watermark.
No attribution required.
Commercial Use Available
Free for commercial use.
No need to contact us for commercial use permission.