Significant Figures & Scientific Notation Calculator

Last updated

Counts significant figures by the OpenStax rules: nonzero digits and captive zeros count, leading zeros never do, and trailing zeros count only after a decimal point, so 1200 is ambiguous. It rounds with exact decimal string arithmetic, half to even by default as NIST SP 811 rule B.7.1 specifies, or half away from zero, and shows the result in plain, scientific, engineering and E notation, with a table explaining every digit.

Significant figures in the number –
Rounded value –
Scientific notation –
Engineering notation –
E notation –
With the other rounding rule –
Why each digit counts or not

Type a number and the calculator counts its significant figures, explains every digit in a table, and rounds it to the figures you choose, as a plain decimal and in scientific, engineering and E notation. Trailing zeros you type survive: 1.200 keeps its four significant figures. The default, 0.004050, has 4 significant figures. Rounded to 2, it gives 0.0040 under the default round-half-to-even rule and 0.0041 under round half away from zero.

How significant figures are counted

NIST Special Publication 811, the Guide for the Use of the International System of Units by A. Thompson and B. N. Taylor (2008), defines it: "A digit is significant if it is required to express the numerical value of a quantity." The OpenStax textbook Chemistry 2e (2019) gives a practical counting rule. Start with the first nonzero digit on the left and count it and every digit to its right, unless the last digit is a trailing zero to the left of the decimal point. That gives three kinds of zero:

  • Leading zeros, before the first nonzero digit, are never significant. They "merely tell us where the decimal point is located".
  • Captive zeros, between nonzero digits, are always significant.
  • Trailing zeros count after a decimal point, but are ambiguous at the end of a whole number.

NIST's own example of the ambiguity is a length of 1200 m: "it is not possible to tell whether the last two zeroes are significant or only indicate the magnitude". Written as 1.200 km, the zeros are significant, because otherwise the value would have been written 1.2 km. For such numbers the calculator reports a range, such as 2 to 4 (ambiguous), and when the round-to field is blank it rounds to the lower figure, following OpenStax's advice that "it is prudent to assume that all trailing zeros are not significant" when only the decimal form is available.

OpenStax's example of digits that claim too much is the US population reported for January 2014, 317,297,725. If the count is good to about a million, 3.17 × 10⁸ is the honest figure, which is what rounding to 3 here gives.

How the rounding works

To round a number x to n significant figures, find the power of ten of its first significant digit, keep n digits from there, and decide what to do with the rest:

e = ⌊log₁₀ |x|⌋,   xrounded = round(x ÷ 10e − n + 1) × 10e − n + 1

The exponent e is the whole-number part of the common logarithm of the number's size, the same exponent that scientific notation shows. NIST SP 811, Appendix B.7.1, gives three rules for the digits being discarded:

  1. If they begin with a digit less than 5, the last kept digit is unchanged: 6.974 951 5 to 3 digits is 6.97.
  2. If they begin with a 5 and at least one later digit is greater than 0, the last kept digit goes up by 1: the same number to 5 digits is 6.9750.
  3. If they begin with a 5 and all later digits are 0, "the digit preceding the 5 is unchanged if it is even and increased by 1 if it is odd", so the final digit is always even. NIST's example is 6.974 950 5 to 7 digits, which is 6.974 950.

Rule 3 is round half to even, the default here. OpenStax teaches the same rule, with the example 92.85 to three significant figures giving 92.8, and explains that it avoids a bias when dropping a 5, which is "equally close to both possible values of the retained digit". The other option, round half away from zero, always raises a dropped 5 on its own: it gives 92.9 and 6.974 951.

The calculator rounds the decimal digits as text, never a binary floating-point number. The Python documentation warns that round(2.675, 2) gives 2.67 instead of the expected 2.68, because "most decimal fractions can't be represented exactly as a float". JavaScript's toFixed, per the ECMAScript specification, breaks a tie by picking "the larger" value, but it does so on the binary value, so (2.675).toFixed(2) also gives 2.67. Working on the typed digits, this page rounds 2.675 to 3 significant figures as 2.68 under both rules and handles exponents such as 1e400 that a double cannot hold.

The defaults, worked by hand

The digit table marks the first three zeros of 0.004050 as leading zeros, in the 10⁰, 10⁻¹ and 10⁻² places, which only place the decimal point. The 4 sits in the 10⁻³ place and is the first significant digit. The zero after it is captive between 4 and 5, so it counts. The final zero comes after the decimal point, so it counts too. That makes 4 significant figures: 4, 0, 5 and 0.

Rounding to 2 keeps the digits 4 and 0 and drops 50. That is an exact tie, so rule 3 applies. The kept digit before the 5 is 0, which is even, so it stays: 0.0040. Its trailing zero is significant, so it is not written 0.004. Under round half away from zero the tie goes up instead, to 0.0041. In scientific notation that is 4.0 × 10⁻³, the same in engineering notation because −3 is already a multiple of 3, and 4.0E-3 in E notation.

Scientific, engineering and E notation

Scientific notation writes one nonzero digit before the decimal point and moves the size into a power of ten, which removes the ambiguity of trailing zeros. OpenStax writes 1,300 g as 1.3 × 10³ for two significant figures, 1.30 × 10³ for three and 1.300 × 10³ for four. Engineering notation restricts the power to multiples of three, matching the SI prefixes. SP 811 section 7.9 notes that it is often recommended to choose prefixes so that numerical values fall between 0.1 and 1000, using only prefixes for powers of ten that are multiples of 3, with examples such as 0.009 52 g = 9.52 mg and 2703 W = 2.703 kW. One limit: engineering notation can need more integer digits than there are significant figures. Rounded to 1 significant figure, 0.5 becomes 500 × 10⁻³, where the two zeros only fill places, so check the scientific line when every digit matters.

E notation is how software writes the same idea. RFC 8259, the JSON standard (2017), defines a number as an optional minus sign, an integer part, an optional fraction and an optional exponent, where the exponent part "begins with the letter E in uppercase or lowercase, which may be followed by a plus or minus sign". The calculator's E line follows that grammar, so 4.0E-3 can be pasted into JSON or code. As input it accepts E notation, × 10^ forms such as 6.02 × 10^23 and superscript exponents.

From Archimedes' grains of sand to written rounding rules

In The Sand-Reckoner, Archimedes proposed a number system able to express numbers up to 8 × 10⁶³ in modern notation, enough, he argued, to count the grains of sand that could fit into the universe, according to the MacTutor History of Mathematics archive.

The decimal fractions that significant figures depend on reached European mathematics much later. MacTutor credits the Flemish mathematician Simon Stevin with the first elementary and thorough account of them, in De Thiende (The Tenth), a 29-page booklet of 1585. He did not invent decimals, which Arab and Chinese mathematicians had used long before, but he introduced their use in Europe. Robert Norton's 1608 English translation, Disme, The Arts of Tenths or Decimal Arithmetike, inspired Thomas Jefferson to propose a decimal currency for the United States.

SP 811 gives the principal rounding rules and refers readers to two standards for the details: ISO 31-0:1992 and IEEE/ASTM SI 10-2002, the American National Standard for the SI. In 2008 NIST noted that the ISO/IEC 80000 series would supersede ISO 31.

Significant figures in calculations

OpenStax gives two rules for results computed from measurements. When adding or subtracting, round to the fewest decimal places among the inputs. When multiplying or dividing, round to the fewest significant figures: 0.6238 cm × 6.6 cm = 4.11708 cm², which rounds to 4.1 cm² because 6.6 has only two. NIST applies the same idea to unit conversions in Appendix B.7.2. A length of 36 ft is 10.9728 m, and NIST reports 11.0 m. The "36" could have come from anything between 35.5 and 36.5: an error of ±0.5 ft or, as a percentage of 36, a relative rounding error of ±1.4%. The figure 11.0 has ±0.45% and 11 would have ±4.5%, so three figures keep information that two would lose. The same habit applies to statistics: a mean or a standard deviation straight out of software usually carries more digits than the data can support, so round it before you report it.

Frequently asked questions

How many significant figures does 1200 have?

It could have 2, 3 or 4, and the digits alone cannot say which, so the calculator reports 2 to 4 (ambiguous). The zeros may have been measured or may only show the size of the number. OpenStax advises assuming such trailing zeros are not significant when only the decimal form is available, so the calculator rounds to 2 when you leave the round-to field blank. Writing 1.2 × 10³, 1.20 × 10³ or 1.200 × 10³ removes the doubt, as does NIST's example of 1.200 km in place of 1200 m.

Are zeros significant figures?

It depends on where they stand. Leading zeros, the ones before the first nonzero digit, are never significant: they only place the decimal point. Captive zeros between nonzero digits always count. Trailing zeros count when they come after a decimal point and are ambiguous when they end a whole number. In the default 0.004050, the three leading zeros do not count, the captive zero between 4 and 5 does, and so does the final zero, for 4 significant figures.

What is round half to even, and why is it the default?

When the digits being dropped are exactly a 5 followed by nothing or only zeros, round half to even keeps the last digit if it is even and raises it by 1 if it is odd. It is rule 3 of NIST Special Publication 811, Appendix B.7.1, and OpenStax explains that it avoids a bias when dropping a 5. Rounding the default 0.004050 to 2 significant figures gives 0.0040 this way, while half away from zero gives 0.0041. When anything nonzero follows the 5, both rules round up.

Why does Python or JavaScript round 2.675 to 2.67?

Software that stores numbers in binary floating point cannot hold 2.675 exactly, and the stored value is a little below it. The Python documentation uses this very case: round(2.675, 2) gives 2.67 instead of the expected 2.68. This page works on the decimal digits exactly as you type them, so 2.675 rounded to 3 significant figures is 2.68 under both rules, while 2.665 gives 2.66 half to even and 2.67 half away from zero.

What is the difference between scientific, engineering and E notation?

Scientific notation puts one nonzero digit before the decimal point, as in 6.02 × 10²³. Engineering notation keeps the power of ten a multiple of 3 so it matches an SI prefix, giving 602 × 10²¹ for the same number. E notation writes the power after the letter E, as 6.02E23, which is the form JSON and JavaScript accept. Scientific and E notation keep exactly the same significant figures, while engineering notation sometimes adds place-filling zeros, as in 500 × 10⁻³ for 0.5. The calculator accepts any of them as input.

Sources

  1. NIST Guide to the SI, Appendix B.7: Rules for rounding numbers and converted numerical values of quantities (SP 811, A. Thompson and B. N. Taylor), National Institute of Standards and Technology, 2008
  2. NIST Guide to the SI, Appendix C: Comments on the references, ISO 31 and IEEE/ASTM SI 10 (SP 811, A. Thompson and B. N. Taylor), National Institute of Standards and Technology, 2008
  3. NIST Guide to the SI, Chapter 7.9: Choosing SI prefixes (SP 811, A. Thompson and B. N. Taylor), National Institute of Standards and Technology, 2008
  4. Chemistry 2e, 1.5 Measurement Uncertainty, Accuracy, and Precision (Flowers, Theopold, Langley, Robinson), OpenStax, Rice University, 2019
  5. RFC 8259: The JavaScript Object Notation (JSON) Data Interchange Format, Section 6: Numbers (T. Bray, ed.), Internet Engineering Task Force, 2017
  6. Built-in Functions: round(), Python Software Foundation, Python 3 documentation
  7. ECMAScript Language Specification, 21.1.3.3 Number.prototype.toFixed, Ecma International TC39
  8. Simon Stevin biography, MacTutor History of Mathematics, University of St Andrews
  9. Archimedes of Syracuse biography, MacTutor History of Mathematics, University of St Andrews