Sig Figs Calculator

.sig-fig-container { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; max-width: 800px; margin: 20px auto; padding: 25px; border: 1px solid #e1e1e1; border-radius: 12px; background-color: #ffffff; box-shadow: 0 4px 15px rgba(0,0,0,0.05); } .sig-fig-container h2 { color: #1a73e8; margin-top: 0; text-align: center; font-size: 28px; } .calculator-box { background: #f8f9fa; padding: 20px; border-radius: 8px; margin-bottom: 30px; } .input-group { margin-bottom: 20px; } .input-group label { display: block; font-weight: 600; margin-bottom: 8px; color: #333; } .input-group input { width: 100%; padding: 12px; border: 2px solid #ddd; border-radius: 6px; font-size: 16px; box-sizing: border-box; transition: border-color 0.3s; } .input-group input:focus { border-color: #1a73e8; outline: none; } .btn-calc { background-color: #1a73e8; color: white; border: none; padding: 15px 25px; font-size: 18px; font-weight: bold; border-radius: 6px; cursor: pointer; width: 100%; transition: background-color 0.3s; } .btn-calc:hover { background-color: #1557b0; } .results-panel { margin-top: 25px; padding: 20px; background-color: #e8f0fe; border-radius: 8px; display: none; } .result-row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid #cddcfb; } .result-row:last-child { border-bottom: none; } .result-label { font-weight: 600; color: #444; } .result-value { font-weight: 700; color: #1a73e8; } .sig-fig-article { line-height: 1.6; color: #333; } .sig-fig-article h3 { color: #222; margin-top: 25px; border-bottom: 2px solid #1a73e8; display: inline-block; padding-bottom: 5px; } .sig-fig-article p { margin-bottom: 15px; } .rule-box { background: #fff9c4; padding: 15px; border-left: 5px solid #fbc02d; margin: 15px 0; }

Significant Figures Calculator

Significant Figure Count: 0
Rounded Value:
Scientific Notation:

What are Significant Figures?

Significant figures (often called "sig figs") are the digits in a number that carry meaningful information about its precision. In scientific measurements, the number of sig figs tells the reader how accurate the measurement is, indicating which digits are certain and which one is the final estimated digit.

The 4 Golden Rules of Significant Figures:
  1. Non-zero digits: All non-zero numbers (1-9) are always significant.
  2. Sandwiched zeros: Zeros between non-zero digits are always significant (e.g., 405 has 3 sig figs).
  3. Leading zeros: Zeros to the left of the first non-zero digit are never significant (e.g., 0.002 has only 1 sig fig).
  4. Trailing zeros: Zeros at the end of a number are significant only if there is a decimal point (e.g., 150.0 has 4 sig figs, but 150 typically has 2).

Why Precision Matters

In chemistry, physics, and engineering, you cannot report a result that is more precise than your least precise measurement. For example, if you measure a table with a ruler that only shows centimeters, you cannot claim the table is exactly 120.4532 millimeters long. The sig figs calculator helps you maintain scientific integrity by rounding your calculations to the appropriate level of uncertainty.

Calculation Examples

  • 0.0056: 2 Significant Figures (leading zeros ignored).
  • 400.0: 4 Significant Figures (trailing zeros after decimal are significant).
  • 1,020: 3 Significant Figures (trailing zero without decimal is usually not significant).
  • 6.022 x 1023: 4 Significant Figures (only the coefficient is counted).
function processSignificantFigures() { var inputVal = document.getElementById('numberInput').value.trim(); var roundTo = document.getElementById('roundTo').value; var resultsPanel = document.getElementById('resultsPanel'); if (inputVal === "" || isNaN(parseFloat(inputVal))) { alert("Please enter a valid numeric value."); return; } var count = countSigFigs(inputVal); document.getElementById('sigCountDisplay').innerText = count; var numObj = parseFloat(inputVal); document.getElementById('scientificDisplay').innerText = numObj.toExponential(); if (roundTo !== "" && parseInt(roundTo) > 0) { var target = parseInt(roundTo); var rounded = numObj.toPrecision(target); document.getElementById('roundedValueDisplay').innerText = rounded; document.getElementById('roundedRow').style.display = 'flex'; } else { document.getElementById('roundedRow').style.display = 'none'; } resultsPanel.style.display = 'block'; } function countSigFigs(n) { var s = n.toString().toLowerCase().trim(); // Handle scientific notation e.g. 6.02e23 if (s.indexOf('e') !== -1) { s = s.split('e')[0]; } // Remove negative sign s = s.replace(/^-/, "); // If it's just zero if (parseFloat(s) === 0) { // "0.00" has significance if decimal is present and trailing if (s.indexOf('.') !== -1) { // Remove leading zeros: 0.00 -> .00 -> length 2 (incorrect, logic below is better) var decimalParts = s.split('.'); if(parseInt(decimalParts[0]) === 0) { // It's like 0.000 -> count trailing zeros return s.length – s.indexOf('.') – 1; } } return 1; } if (s.indexOf('.') !== -1) { // Rule: With decimal, count from first non-zero to the end // 0.00120 -> 120 (3) s = s.replace('.', "); var firstNonZero = -1; for (var i = 0; i 12 (2) var clean = s.replace(/^0+/, "); // Leading zeros clean = clean.replace(/0+$/, "); // Trailing zeros (ambiguous rule – standard is non-sig) return clean.length; } }

Leave a Comment