{"id":1957,"date":"2025-01-24T06:13:54","date_gmt":"2025-01-24T06:13:54","guid":{"rendered":"https:\/\/donhit.com\/en\/?p=1957"},"modified":"2025-02-07T09:06:28","modified_gmt":"2025-02-07T09:06:28","slug":"percent-error","status":"publish","type":"post","link":"https:\/\/donhit.com\/en\/calculator\/percent-error\/","title":{"rendered":"Percent Error Calculator"},"content":{"rendered":"<p><center><div class=\"glass-morphism p-8 rounded-xl w-full max-w-md shadow-2xl\">\r\n        <h2 class=\"text-3xl font-bold mb-6 text-center text-white\">Percent Error Calculator<\/h2>\r\n        \r\n        <div class=\"space-y-4\">\r\n            <div>\r\n                <label class=\"block text-white mb-2\" for=\"experimental\">Experimental Value<\/label>\r\n                <input \r\n                    id=\"experimental\" \r\n                    type=\"number\" \r\n                    placeholder=\"Enter experimental value\" \r\n                    class=\"w-full p-3 rounded-lg bg-white bg-opacity-20 text-white placeholder-gray-300 input-glow border-none focus:outline-none\"\r\n                >\r\n            <\/div>\r\n            \r\n            <div>\r\n                <label class=\"block text-white mb-2\" for=\"theoretical\">Theoretical Value<\/label>\r\n                <input \r\n                    id=\"theoretical\" \r\n                    type=\"number\" \r\n                    placeholder=\"Enter theoretical value\" \r\n                    class=\"w-full p-3 rounded-lg bg-white bg-opacity-20 text-white placeholder-gray-300 input-glow border-none focus:outline-none\"\r\n                >\r\n            <\/div>\r\n            \r\n            <button \r\n                id=\"calculate\" \r\n                class=\"w-full bg-indigo-600 text-white py-3 rounded-lg hover:bg-indigo-700 transition duration-300 transform hover:scale-105 active:scale-95\"\r\n            >\r\n                Calculate Percent Error\r\n            <\/button>\r\n            \r\n            <div \r\n                id=\"result\" \r\n                class=\"mt-4 p-4 text-center font-semibold rounded-lg hidden text-white\"\r\n            ><\/div>\r\n        <\/div>\r\n    <\/div>\r\n\r\n    <script>\r\n        const experimentalInput = document.getElementById('experimental');\r\n        const theoreticalInput = document.getElementById('theoretical');\r\n        const calculateBtn = document.getElementById('calculate');\r\n        const resultDiv = document.getElementById('result');\r\n\r\n        calculateBtn.addEventListener('click', () => {\r\n            const experimental = parseFloat(experimentalInput.value);\r\n            const theoretical = parseFloat(theoreticalInput.value);\r\n\r\n            if (isNaN(experimental) || isNaN(theoretical)) {\r\n                resultDiv.textContent = 'Invalid Input! Please enter valid numbers.';\r\n                resultDiv.className = 'mt-4 p-4 text-center font-semibold rounded-lg bg-red-500 text-white animate-pulse-soft';\r\n                resultDiv.classList.remove('hidden');\r\n                return;\r\n            }\r\n\r\n            const percentError = Math.abs((experimental - theoretical) \/ theoretical) * 100;\r\n            \r\n            resultDiv.textContent = `Percent Error: ${percentError.toFixed(2)}%`;\r\n            resultDiv.className = 'mt-4 p-4 text-center font-semibold rounded-lg bg-green-500 text-white animate-pulse-soft';\r\n            resultDiv.classList.remove('hidden');\r\n        });\r\n\r\n        [experimentalInput, theoreticalInput].forEach(input => {\r\n            input.addEventListener('keypress', (e) => {\r\n                if (e.key === 'Enter') {\r\n                    calculateBtn.click();\r\n                }\r\n            });\r\n        });\r\n    <\/script><\/center>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[184],"tags":[],"class_list":["post-1957","post","type-post","status-publish","format-standard","hentry","category-calculator"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.0 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Percent Error Calculator - DonHit<\/title>\n<meta name=\"description\" content=\"The percent error formula is a straightforward tool for evaluating how close an experimental value is to the actual or accepted value in measurements or calculations\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/donhit.com\/en\/calculator\/percent-error\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Percent Error Calculator - DonHit\" \/>\n<meta property=\"og:description\" content=\"The percent error formula is a straightforward tool for evaluating how close an experimental value is to the actual or accepted value in measurements or calculations\" \/>\n<meta property=\"og:url\" content=\"https:\/\/donhit.com\/en\/calculator\/percent-error\/\" \/>\n<meta property=\"og:site_name\" content=\"DonHit - World of Tools\" \/>\n<meta property=\"article:published_time\" content=\"2025-01-24T06:13:54+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-02-07T09:06:28+00:00\" \/>\n<meta name=\"author\" content=\"DonHit\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"DonHit\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Percent Error Calculator - DonHit","description":"The percent error formula is a straightforward tool for evaluating how close an experimental value is to the actual or accepted value in measurements or calculations","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/donhit.com\/en\/calculator\/percent-error\/","og_locale":"en_US","og_type":"article","og_title":"Percent Error Calculator - DonHit","og_description":"The percent error formula is a straightforward tool for evaluating how close an experimental value is to the actual or accepted value in measurements or calculations","og_url":"https:\/\/donhit.com\/en\/calculator\/percent-error\/","og_site_name":"DonHit - World of Tools","article_published_time":"2025-01-24T06:13:54+00:00","article_modified_time":"2025-02-07T09:06:28+00:00","author":"DonHit","twitter_card":"summary_large_image","twitter_misc":{"Written by":"DonHit","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/donhit.com\/en\/calculator\/percent-error\/#article","isPartOf":{"@id":"https:\/\/donhit.com\/en\/calculator\/percent-error\/"},"author":{"name":"DonHit","@id":"https:\/\/donhit.com\/en\/#\/schema\/person\/0c6ff7dcd8ba4810c56a532f09c33148"},"headline":"Percent Error Calculator","datePublished":"2025-01-24T06:13:54+00:00","dateModified":"2025-02-07T09:06:28+00:00","mainEntityOfPage":{"@id":"https:\/\/donhit.com\/en\/calculator\/percent-error\/"},"wordCount":10,"commentCount":0,"publisher":{"@id":"https:\/\/donhit.com\/en\/#\/schema\/person\/0c6ff7dcd8ba4810c56a532f09c33148"},"articleSection":["Calculator"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/donhit.com\/en\/calculator\/percent-error\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/donhit.com\/en\/calculator\/percent-error\/","url":"https:\/\/donhit.com\/en\/calculator\/percent-error\/","name":"Percent Error Calculator - DonHit","isPartOf":{"@id":"https:\/\/donhit.com\/en\/#website"},"datePublished":"2025-01-24T06:13:54+00:00","dateModified":"2025-02-07T09:06:28+00:00","description":"The percent error formula is a straightforward tool for evaluating how close an experimental value is to the actual or accepted value in measurements or calculations","breadcrumb":{"@id":"https:\/\/donhit.com\/en\/calculator\/percent-error\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/donhit.com\/en\/calculator\/percent-error\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/donhit.com\/en\/calculator\/percent-error\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Trang ch\u1ee7","item":"https:\/\/donhit.com\/en\/"},{"@type":"ListItem","position":2,"name":"Calculator","item":"https:\/\/donhit.com\/en\/category\/calculator\/"},{"@type":"ListItem","position":3,"name":"Percent Error Calculator"}]},{"@type":"WebSite","@id":"https:\/\/donhit.com\/en\/#website","url":"https:\/\/donhit.com\/en\/","name":"DonHit - World of tools","description":"","publisher":{"@id":"https:\/\/donhit.com\/en\/#\/schema\/person\/0c6ff7dcd8ba4810c56a532f09c33148"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/donhit.com\/en\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/donhit.com\/en\/#\/schema\/person\/0c6ff7dcd8ba4810c56a532f09c33148","name":"DonHit","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/donhit.com\/en\/#\/schema\/person\/image\/","url":"https:\/\/donhit.com\/en\/wp-content\/uploads\/2024\/11\/logo-donhit.webp","contentUrl":"https:\/\/donhit.com\/en\/wp-content\/uploads\/2024\/11\/logo-donhit.webp","width":400,"height":267,"caption":"DonHit"},"logo":{"@id":"https:\/\/donhit.com\/en\/#\/schema\/person\/image\/"},"description":"DonHit is a website designed to provide useful tools for everyone. Its primary goal is to support and empower the community. All the tools available on the site are completely free to use.","sameAs":["https:\/\/donhit.com\/en"],"url":"https:\/\/donhit.com\/en\/author\/admin_don\/"}]}},"_links":{"self":[{"href":"https:\/\/donhit.com\/en\/wp-json\/wp\/v2\/posts\/1957","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/donhit.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/donhit.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/donhit.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/donhit.com\/en\/wp-json\/wp\/v2\/comments?post=1957"}],"version-history":[{"count":2,"href":"https:\/\/donhit.com\/en\/wp-json\/wp\/v2\/posts\/1957\/revisions"}],"predecessor-version":[{"id":2153,"href":"https:\/\/donhit.com\/en\/wp-json\/wp\/v2\/posts\/1957\/revisions\/2153"}],"wp:attachment":[{"href":"https:\/\/donhit.com\/en\/wp-json\/wp\/v2\/media?parent=1957"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/donhit.com\/en\/wp-json\/wp\/v2\/categories?post=1957"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/donhit.com\/en\/wp-json\/wp\/v2\/tags?post=1957"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}