An absolute error represents the error or error value when measuring something. A relative error compares the absolute error with the actual size of the measured object. To calculate the relative error, you also need to calculate the absolute error. If you try to measure a 12 cm object and you miss the measurement by 6 cm, the relative error will be too large. However, when trying to measure something 120 m and missing this measurement by only 6 cm, the relative error will be much smaller  even if the absolute error value, 6 cm, is the same as in the previous case.
Steps
Method 1 of 2: Calculating the Absolute Error
Step 1. Absolute error can be subtracted from the expected value
The expected value is usually provided by tests or laboratory tests. Basically, it is the most accurate and common measure proposed, usually in common equations and reactions. You can compare your own results to get the absolute error, which measures the error of the expected result. To do this, simply subtract the measure value from the expected value. Even if the result is negative, make it positive. This is the absolute mistake!

Example:
you need to know how accurately you can estimate a distance by measuring it in steps. You measure the distance in steps from one tree to another and estimates it to be 18 m. This is the experimental value. Then you take the measurement again, but this time using a tape measure or measuring tape to get the exact distance, and you find that, in fact, the trees are 20 m apart. This is the "actual" value. The absolute error is 20  18 = 2 m.
Step 2. Alternatively, when measuring something, assume that the absolute error is the smallest unit of measurement available to you
For example, if you are measuring something with a onemeter ruler, the smallest measurement on it will be 1 millimeter (mm). That way you know that the measurement will have an accuracy of + or  1 mm; the absolute error is 1 mm.
This works for any measurement system. Many scientific tools, such as a precision dropper or other measurement equipment, often have an absolute error label labeled "+/________"
Step 3. Always add the corresponding measurement units
Let's say the absolute error is "2 m". This value indicates the error of your measurement. However, if you write that the error was only "2", no one will know what that measure is. Use the same units as the ones you measured.
Step 4. Practice with several examples
The best way to learn how to calculate error is through practice. Solve the following exercises and select the space after the colon (:) to see the answer.
 Jill is studying chemical reactions. After some mixing and matching, she got 32 g in her test tube. The accepted value of the experiment was 34 g. Your absolute error is: +/ 2 g
 Leonardo is testing some chemical reactions. It uses 10ml of water drops to cause a reaction, but the dropper shows the message "+/ 0.5ml". The absolute error of this measurement must be: +/ 0.5 ml.
Step 5. Understand what causes the error and how to eliminate it
All scientific studies are prone to some kind of error  even discoveries and Nobel Prize winning works have a margin of error. Still, knowing the source of the error is essential to help you prevent it:
 Human error is the most common. It ranges from wrong measurements to false assumptions or errors in the laboratory.
 Incidental energy/material loss, such as a small amount of liquid remaining in a test tube after pouring it into another container, changes in temperature due to the environment, etc.
 Failures in equipment used for measurements or studies, such as very small and accurate measurements, or burners that provide uneven heat.
Method 2 of 2: Calculating Relative Error
Step 1. Divide the absolute error by the actual value of the object in question to get the relative error
This result is the relative error. This simple equation indicates the margin of error compared to the overall measurement. Of course, a low relative error is desired. To continue the measurement example between the two trees:
 The absolute error was 2 m and the real value was 20 m.
 2m20m{displaystyle {frac {2m}{20m}}}
 Erro relativo =0, 1m{displaystyle =0, 1m}
Step 2. Multiply the answer by 100 to transform the value into a percentage and understand it better
Leave the relative error as a fraction, complete the division to arrive at the decimal value, or multiply the decimal result by 100 to leave the answer as a percentage. This indicates the final error value in percentage. If you are measuring a 200 m boat and you are missing the measurement by 2 m, the percentage of error will be much smaller than missing the measurement by 20 m of the tree distance by 2 m. In this case, the error is a smaller percentage of the total measure.
 2m20m=0, 1m{displaystyle {frac {2m}{20m}}=0, 1m}
 0, 1∗100=10%{displaystyle 0, 1*100=10\%}
de erro relativo.
Step 3. Calculate the relative error at once by transforming the numerator (number on top of the fraction) into the absolute error equation
Once you understand the difference between relative and absolute error, there is no need to do the entire process at once. Just replace the absolute error equation with the real number obtained. Note that vertical bars are signs of absolute values, that is, any value within them must be positive.
 Relative error =Measured−RealReal{displaystyle ={frac {\mathrm {Measured} \mathrm {Real} }{mathrm {Real} }}}
 Multiplique tudo por 100 para obter a porcentagem do erro relativo de uma só vez.
Step 4. Always include measurement units to identify context
As before, you need to identify the unit of measure; otherwise, a simple "2" may mean nothing to anyone. Be aware, however, that this is not necessary if you give the percentage value, as the error is not 10% of 2m. However, you can say that you had a "10% relative error".