{"id":8311122,"date":"2025-09-18T11:33:34","date_gmt":"2025-09-18T08:33:34","guid":{"rendered":"https:\/\/elementor.com\/tools\/?p=8311122"},"modified":"2025-09-18T11:33:53","modified_gmt":"2025-09-18T08:33:53","slug":"refund-calculator","status":"publish","type":"post","link":"https:\/\/elementor.com\/tools\/refund-calculator\/","title":{"rendered":"Refund Calculator"},"content":{"rendered":"\t\t<div data-elementor-type=\"container\" data-elementor-id=\"8311120\" class=\"elementor elementor-8311120\" data-elementor-post-type=\"elementor_library\">\n\t\t\t\t<div class=\"elementor-element elementor-element-23691a2c e-flex e-con-boxed e-con e-parent\" data-id=\"23691a2c\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t<div class=\"elementor-element elementor-element-37c3711c elementor-widget elementor-widget-html\" data-id=\"37c3711c\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"html.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<style>\r\n    \/* --- Styles Adapted from Your Code --- *\/\r\n    .html-viewer-app {\r\n        width: 100%;\r\n        max-width: 700px; \/* Adjusted for a single panel layout *\/\r\n        margin: 0 auto;\r\n        padding: 60px 0 0;\r\n        font-family: 'DM Sans', sans-serif;\r\n    }\r\n\r\n    .main-content {\r\n        display: flex;\r\n        justify-content: center;\r\n        align-items: flex-start;\r\n        padding: 0 15px;\r\n    }\r\n\r\n    .input-section {\r\n        flex: 1;\r\n        width: 100%;\r\n        max-width: 600px;\r\n        height: auto;\r\n        display: flex;\r\n        flex-direction: column;\r\n        background: white;\r\n        border-radius: 8px;\r\n        overflow: hidden;\r\n        border: 1.5px solid #EBEBEB;\r\n        box-shadow: 0 4px 15px rgba(0,0,0,0.05);\r\n    }\r\n\r\n    .section-header {\r\n        background-color: #05047E;\r\n        color: white;\r\n        padding: 16px 20px;\r\n        font-weight: 500;\r\n        font-size: 1.25rem;\r\n    }\r\n\r\n    .format-btn {\r\n        background-color: #000;\r\n        color: white;\r\n        border: none;\r\n        padding: 12px 20px;\r\n        cursor: pointer;\r\n        font-size: 1.125rem;\r\n        font-weight: 500;\r\n        transition: all 0.2s;\r\n        pointer-events: all;\r\n        min-width: 11rem;\r\n        text-align: center;\r\n        border-radius: 4px;\r\n    }\r\n\r\n    .format-btn:is(:hover, :focus, :focus-visible, :active){\r\n        background-color: #545454;\r\n    }\r\n    \r\n    \/* Applying the pink style from your #minifyBtn to our calculate button *\/\r\n    #calculateBtn {\r\n        background-color: #ff7be5;\r\n        color: black;\r\n    }\r\n\r\n    #calculateBtn:is(:hover, :focus, :focus-visible, :active) {\r\n        background-color: #ffa8ee;\r\n    }\r\n\r\n    .reset-btn {\r\n        background: none;\r\n        border: none;\r\n        color: #545454;\r\n        text-decoration: underline;\r\n        font-size: 1rem;\r\n        cursor: pointer;\r\n        padding: 0;\r\n        transition: color 0.2s;\r\n    }\r\n\r\n    .reset-btn:is(:hover, :focus, :focus-visible, :active) {\r\n        background: none;\r\n        color: #000;\r\n        text-decoration: underline;\r\n    }\r\n\r\n    \/* --- New Styles for the Calculator --- *\/\r\n    .calculator-body {\r\n        padding: 25px;\r\n        display: flex;\r\n        flex-direction: column;\r\n        gap: 20px;\r\n    }\r\n\r\n    .form-group {\r\n        display: flex;\r\n        flex-direction: column;\r\n        gap: 8px;\r\n    }\r\n\r\n    .form-group label {\r\n        font-weight: 500;\r\n        font-size: 1rem;\r\n        color: #333;\r\n    }\r\n\r\n    .form-group input[type=\"number\"] {\r\n        width: 100%;\r\n        padding: 12px;\r\n        border: 1.5px solid #EBEBEB;\r\n        border-radius: 4px;\r\n        font-size: 1rem;\r\n        font-family: inherit;\r\n        box-sizing: border-box; \/* Important for padding and border *\/\r\n        transition: border-color 0.2s, box-shadow 0.2s;\r\n    }\r\n\r\n    .form-group input[type=\"number\"]:focus {\r\n        outline: none;\r\n        border-color: #05047E;\r\n        box-shadow: 0 0 0 2px rgba(5, 4, 126, 0.2);\r\n    }\r\n    \r\n    \/* Hide number input spinners *\/\r\n    input::-webkit-outer-spin-button,\r\n    input::-webkit-inner-spin-button {\r\n      -webkit-appearance: none;\r\n      margin: 0;\r\n    }\r\n    input[type=number] {\r\n      -moz-appearance: textfield;\r\n    }\r\n\r\n    .button-container {\r\n        display: flex;\r\n        flex-direction: column;\r\n        align-items: center;\r\n        gap: 15px;\r\n        margin-top: 10px;\r\n    }\r\n    \r\n    #results-section {\r\n        margin-top: 15px;\r\n        padding: 20px;\r\n        background-color: #f7f7ff;\r\n        border: 1.5px dashed #d6d6e6;\r\n        border-radius: 6px;\r\n        text-align: center;\r\n        opacity: 0;\r\n        transform: translateY(10px);\r\n        transition: opacity 0.4s ease, transform 0.4s ease;\r\n        visibility: hidden;\r\n    }\r\n\r\n    #results-section.show {\r\n        opacity: 1;\r\n        transform: translateY(0);\r\n        visibility: visible;\r\n    }\r\n\r\n    #results-section h4 {\r\n        margin: 0 0 15px 0;\r\n        color: #05047E;\r\n        font-size: 1.1rem;\r\n    }\r\n\r\n    #results-section p {\r\n        margin: 5px 0;\r\n        font-size: 1rem;\r\n        color: #333;\r\n    }\r\n    \r\n    #results-section .refund-amount {\r\n        font-size: 1.75rem;\r\n        font-weight: 700;\r\n        color: #00D084; \/* A green color from your provided variables *\/\r\n        margin: 10px 0;\r\n    }\r\n\r\n    #error-message {\r\n        color: #cf2e2e; \/* A red color from your provided variables *\/\r\n        font-weight: 500;\r\n        text-align: center;\r\n    }\r\n<\/style>\r\n\r\n<div class=\"html-viewer-app\">\r\n    <div class=\"main-content\">\r\n        <div class=\"input-section\">\r\n            <div class=\"section-header\">\r\n                <h2>Refund Calculator<\/h2>\r\n            <\/div>\r\n            <div class=\"calculator-body\">\r\n                <div class=\"form-group\">\r\n                    <label for=\"originalPrice\">Original Purchase Price ($)<\/label>\r\n                    <input type=\"number\" id=\"originalPrice\" placeholder=\"e.g., 199.99\" step=\"0.01\" min=\"0\">\r\n                <\/div>\r\n                \r\n                <div class=\"form-group\">\r\n                    <label for=\"refundPercentage\">Refund Percentage (%)<\/label>\r\n                    <input type=\"number\" id=\"refundPercentage\" placeholder=\"e.g., 85\" step=\"1\" min=\"0\" max=\"100\">\r\n                <\/div>\r\n\r\n                <div class=\"form-group\">\r\n                    <label for=\"fixedFee\">Fixed Deduction \/ Restocking Fee ($)<\/label>\r\n                    <input type=\"number\" id=\"fixedFee\" placeholder=\"e.g., 10.00\" value=\"0\" step=\"0.01\" min=\"0\">\r\n                <\/div>\r\n\r\n                <div class=\"button-container\">\r\n                    <button id=\"calculateBtn\" class=\"format-btn\">Calculate Refund<\/button>\r\n                    <button id=\"resetBtn\" class=\"reset-btn\">Reset Fields<\/button>\r\n                <\/div>\r\n\r\n                <div id=\"results-section\">\r\n                    <!-- JS will populate this area -->\r\n                <\/div>\r\n            <\/div>\r\n        <\/div>\r\n    <\/div>\r\n<\/div>\r\n\r\n<script>\r\n    document.addEventListener('DOMContentLoaded', function() {\r\n        \/\/ --- Element Selection ---\r\n        const originalPriceInput = document.getElementById('originalPrice');\r\n        const refundPercentageInput = document.getElementById('refundPercentage');\r\n        const fixedFeeInput = document.getElementById('fixedFee');\r\n        const calculateBtn = document.getElementById('calculateBtn');\r\n        const resetBtn = document.getElementById('resetBtn');\r\n        const resultsSection = document.getElementById('results-section');\r\n\r\n        \/\/ --- Event Listeners ---\r\n        calculateBtn.addEventListener('click', handleCalculation);\r\n        resetBtn.addEventListener('click', handleReset);\r\n        \r\n        \/\/ Allow pressing Enter to calculate\r\n        [originalPriceInput, refundPercentageInput, fixedFeeInput].forEach(input => {\r\n            input.addEventListener('keydown', function(event) {\r\n                if (event.key === 'Enter') {\r\n                    event.preventDefault();\r\n                    handleCalculation();\r\n                }\r\n            });\r\n        });\r\n\r\n        \/\/ --- Core Functions ---\r\n        function handleCalculation() {\r\n            \/\/ 1. Get and Parse Values\r\n            const price = parseFloat(originalPriceInput.value);\r\n            const percentage = parseFloat(refundPercentageInput.value);\r\n            const fee = parseFloat(fixedFeeInput.value) || 0; \/\/ Default fee to 0 if empty\r\n\r\n            \/\/ 2. Validate Inputs\r\n            if (isNaN(price) || price < 0 || isNaN(percentage) || percentage < 0 || percentage > 100) {\r\n                showError(\"Please enter valid positive numbers. Percentage must be between 0 and 100.\");\r\n                return;\r\n            }\r\n            \r\n            \/\/ 3. Perform Calculation\r\n            const refundFromPercentage = price * (percentage \/ 100);\r\n            let finalRefund = refundFromPercentage - fee;\r\n            \r\n            \/\/ Ensure refund doesn't go below zero\r\n            finalRefund = Math.max(0, finalRefund);\r\n\r\n            const amountKept = price - finalRefund;\r\n            \r\n            \/\/ 4. Display Results\r\n            displayResults(finalRefund, amountKept, price);\r\n        }\r\n\r\n        function displayResults(refund, kept, original) {\r\n            resultsSection.innerHTML = `\r\n                <h4>Calculation Complete<\/h4>\r\n                <p>Total Refund Amount<\/p>\r\n                <p class=\"refund-amount\">$${refund.toFixed(2)}<\/p>\r\n                <p>Amount not refunded: <strong>$${kept.toFixed(2)}<\/strong><\/p>\r\n                <p style=\"font-size: 0.9em; color: #555;\">(Based on original price of $${original.toFixed(2)})<\/p>\r\n            `;\r\n            resultsSection.classList.add('show');\r\n        }\r\n\r\n        function showError(message) {\r\n            resultsSection.innerHTML = `<p id=\"error-message\">${message}<\/p>`;\r\n            resultsSection.classList.add('show');\r\n        }\r\n\r\n        function handleReset() {\r\n            originalPriceInput.value = '';\r\n            refundPercentageInput.value = '';\r\n            fixedFeeInput.value = '0';\r\n            resultsSection.innerHTML = '';\r\n            resultsSection.classList.remove('show');\r\n            originalPriceInput.focus();\r\n        }\r\n    });\r\n<\/script>\r\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":5,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[22],"tags":[21],"class_list":["post-8311122","post","type-post","status-publish","format-standard","hentry","category-tools","tag-html-css-tools"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.2 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Refund Calculator<\/title>\n<meta name=\"description\" content=\"Calculate refunds accurately and easily for your Elementor website. Our free Refund Calculator handles purchase price, taxes, and fees. Streamline your business finances!\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/elementor.com\/tools\/refund-calculator\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Refund Calculator\" \/>\n<meta property=\"og:description\" content=\"Calculate refunds accurately and easily for your Elementor website. Our free Refund Calculator handles purchase price, taxes, and fees. Streamline your business finances!\" \/>\n<meta property=\"og:url\" content=\"https:\/\/elementor.com\/tools\/refund-calculator\/\" \/>\n<meta property=\"og:site_name\" content=\"Tools\" \/>\n<meta property=\"article:published_time\" content=\"2025-09-18T08:33:34+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-09-18T08:33:53+00:00\" \/>\n<meta name=\"author\" content=\"liz@148.red\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"liz@148.red\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/elementor.com\/tools\/refund-calculator\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/elementor.com\/tools\/refund-calculator\/\"},\"author\":{\"name\":\"liz@148.red\",\"@id\":\"https:\/\/elementor.com\/tools\/#\/schema\/person\/80e8375cb95e6030bc2f897c41c985ac\"},\"headline\":\"Refund Calculator\",\"datePublished\":\"2025-09-18T08:33:34+00:00\",\"dateModified\":\"2025-09-18T08:33:53+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/elementor.com\/tools\/refund-calculator\/\"},\"wordCount\":4,\"keywords\":[\"Html-Css-tools\"],\"articleSection\":[\"tools\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/elementor.com\/tools\/refund-calculator\/\",\"url\":\"https:\/\/elementor.com\/tools\/refund-calculator\/\",\"name\":\"Refund Calculator\",\"isPartOf\":{\"@id\":\"https:\/\/elementor.com\/tools\/#website\"},\"datePublished\":\"2025-09-18T08:33:34+00:00\",\"dateModified\":\"2025-09-18T08:33:53+00:00\",\"author\":{\"@id\":\"https:\/\/elementor.com\/tools\/#\/schema\/person\/80e8375cb95e6030bc2f897c41c985ac\"},\"description\":\"Calculate refunds accurately and easily for your Elementor website. Our free Refund Calculator handles purchase price, taxes, and fees. Streamline your business finances!\",\"breadcrumb\":{\"@id\":\"https:\/\/elementor.com\/tools\/refund-calculator\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/elementor.com\/tools\/refund-calculator\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/elementor.com\/tools\/refund-calculator\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/elementor.com\/tools\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Refund Calculator\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/elementor.com\/tools\/#website\",\"url\":\"https:\/\/elementor.com\/tools\/\",\"name\":\"Tools\",\"description\":\"Just another Elementor hosted website ;)\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/elementor.com\/tools\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/elementor.com\/tools\/#\/schema\/person\/80e8375cb95e6030bc2f897c41c985ac\",\"name\":\"liz@148.red\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/secure.gravatar.com\/avatar\/63b900d3310bd1ed40162fb27f016e9920ae66fa5be07be5153344329ef7d9d2?s=96&d=mm&r=g\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/63b900d3310bd1ed40162fb27f016e9920ae66fa5be07be5153344329ef7d9d2?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/63b900d3310bd1ed40162fb27f016e9920ae66fa5be07be5153344329ef7d9d2?s=96&d=mm&r=g\",\"caption\":\"liz@148.red\"},\"url\":\"https:\/\/elementor.com\/tools\/author\/liz148-red\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Refund Calculator","description":"Calculate refunds accurately and easily for your Elementor website. Our free Refund Calculator handles purchase price, taxes, and fees. Streamline your business finances!","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:\/\/elementor.com\/tools\/refund-calculator\/","og_locale":"en_US","og_type":"article","og_title":"Refund Calculator","og_description":"Calculate refunds accurately and easily for your Elementor website. Our free Refund Calculator handles purchase price, taxes, and fees. Streamline your business finances!","og_url":"https:\/\/elementor.com\/tools\/refund-calculator\/","og_site_name":"Tools","article_published_time":"2025-09-18T08:33:34+00:00","article_modified_time":"2025-09-18T08:33:53+00:00","author":"liz@148.red","twitter_card":"summary_large_image","twitter_misc":{"Written by":"liz@148.red","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/elementor.com\/tools\/refund-calculator\/#article","isPartOf":{"@id":"https:\/\/elementor.com\/tools\/refund-calculator\/"},"author":{"name":"liz@148.red","@id":"https:\/\/elementor.com\/tools\/#\/schema\/person\/80e8375cb95e6030bc2f897c41c985ac"},"headline":"Refund Calculator","datePublished":"2025-09-18T08:33:34+00:00","dateModified":"2025-09-18T08:33:53+00:00","mainEntityOfPage":{"@id":"https:\/\/elementor.com\/tools\/refund-calculator\/"},"wordCount":4,"keywords":["Html-Css-tools"],"articleSection":["tools"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/elementor.com\/tools\/refund-calculator\/","url":"https:\/\/elementor.com\/tools\/refund-calculator\/","name":"Refund Calculator","isPartOf":{"@id":"https:\/\/elementor.com\/tools\/#website"},"datePublished":"2025-09-18T08:33:34+00:00","dateModified":"2025-09-18T08:33:53+00:00","author":{"@id":"https:\/\/elementor.com\/tools\/#\/schema\/person\/80e8375cb95e6030bc2f897c41c985ac"},"description":"Calculate refunds accurately and easily for your Elementor website. Our free Refund Calculator handles purchase price, taxes, and fees. Streamline your business finances!","breadcrumb":{"@id":"https:\/\/elementor.com\/tools\/refund-calculator\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/elementor.com\/tools\/refund-calculator\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/elementor.com\/tools\/refund-calculator\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/elementor.com\/tools\/"},{"@type":"ListItem","position":2,"name":"Refund Calculator"}]},{"@type":"WebSite","@id":"https:\/\/elementor.com\/tools\/#website","url":"https:\/\/elementor.com\/tools\/","name":"Tools","description":"Just another Elementor hosted website ;)","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/elementor.com\/tools\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/elementor.com\/tools\/#\/schema\/person\/80e8375cb95e6030bc2f897c41c985ac","name":"liz@148.red","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/63b900d3310bd1ed40162fb27f016e9920ae66fa5be07be5153344329ef7d9d2?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/63b900d3310bd1ed40162fb27f016e9920ae66fa5be07be5153344329ef7d9d2?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/63b900d3310bd1ed40162fb27f016e9920ae66fa5be07be5153344329ef7d9d2?s=96&d=mm&r=g","caption":"liz@148.red"},"url":"https:\/\/elementor.com\/tools\/author\/liz148-red\/"}]}},"_links":{"self":[{"href":"https:\/\/elementor.com\/tools\/wp-json\/wp\/v2\/posts\/8311122","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/elementor.com\/tools\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/elementor.com\/tools\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/elementor.com\/tools\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/elementor.com\/tools\/wp-json\/wp\/v2\/comments?post=8311122"}],"version-history":[{"count":1,"href":"https:\/\/elementor.com\/tools\/wp-json\/wp\/v2\/posts\/8311122\/revisions"}],"predecessor-version":[{"id":8311124,"href":"https:\/\/elementor.com\/tools\/wp-json\/wp\/v2\/posts\/8311122\/revisions\/8311124"}],"wp:attachment":[{"href":"https:\/\/elementor.com\/tools\/wp-json\/wp\/v2\/media?parent=8311122"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/elementor.com\/tools\/wp-json\/wp\/v2\/categories?post=8311122"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/elementor.com\/tools\/wp-json\/wp\/v2\/tags?post=8311122"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}