{"id":8310922,"date":"2025-09-16T09:12:11","date_gmt":"2025-09-16T06:12:11","guid":{"rendered":"https:\/\/elementor.com\/tools\/?p=8310922"},"modified":"2025-09-16T09:14:36","modified_gmt":"2025-09-16T06:14:36","slug":"cost-per-mille-calculator","status":"publish","type":"post","link":"https:\/\/elementor.com\/tools\/cost-per-mille-calculator\/","title":{"rendered":"Cost Per Mille Calculator"},"content":{"rendered":"\t\t<div data-elementor-type=\"container\" data-elementor-id=\"8310920\" class=\"elementor elementor-8310920\" 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    \/* --- Base Styles Inspired by Your Design --- *\/\r\n    .cpm-calculator-app {\r\n        width: 100%;\r\n        max-width: 700px; \/* Adjusted for a single-box layout *\/\r\n        margin: 0 auto;\r\n        padding: 60px 0 0;\r\n        background: transparent;\r\n        overflow: visible;\r\n        position: relative;\r\n    }\r\n\r\n    .calculator-container {\r\n        display: flex;\r\n        flex-direction: column;\r\n        background: white;\r\n        border-radius: 8px;\r\n        overflow: hidden;\r\n        box-shadow: 0 4px 15px rgba(0,0,0,0.1);\r\n        border: 1.5px solid #EBEBEB;\r\n    }\r\n\r\n    .section-header {\r\n        background-color: #05047E;\r\n        color: white;\r\n        padding: 16px 24px;\r\n        font-family: 'DM Sans', sans-serif;\r\n        font-weight: 500;\r\n        font-size: 1.25rem;\r\n        text-align: center;\r\n    }\r\n\r\n    \/* --- Form & Input Styles --- *\/\r\n    .calculator-content {\r\n        padding: 24px 32px;\r\n        display: flex;\r\n        flex-direction: column;\r\n        gap: 24px;\r\n    }\r\n    \r\n    .input-group {\r\n        display: flex;\r\n        flex-direction: column;\r\n        gap: 8px;\r\n    }\r\n\r\n    .input-group label {\r\n        font-family: 'DM Sans', sans-serif;\r\n        font-weight: 500;\r\n        font-size: 1rem;\r\n        color: #333;\r\n    }\r\n\r\n    .calculator-input {\r\n        width: 100%;\r\n        border: 1.5px solid #EBEBEB;\r\n        border-radius: 4px;\r\n        outline: none;\r\n        padding: 12px 15px;\r\n        font-family: 'DM Sans', sans-serif;\r\n        font-size: 1rem;\r\n        background-color: #fdfdfd;\r\n        color: #333;\r\n        transition: border-color 0.2s, box-shadow 0.2s;\r\n    }\r\n\r\n    .calculator-input::placeholder {\r\n        color: #adb5bd;\r\n    }\r\n\r\n    .calculator-input:focus {\r\n        border-color: #05047E;\r\n        box-shadow: 0 0 0 3px rgba(5, 4, 126, 0.1);\r\n    }\r\n\r\n    \/* --- Button Styles --- *\/\r\n    .format-btn-container {\r\n        display: flex;\r\n        flex-direction: column;\r\n        align-items: center;\r\n        gap: 12px;\r\n        margin-top: 8px;\r\n    }\r\n\r\n    .format-btn {\r\n        background-color: #ff7be5; \/* Using your #minifyBtn style *\/\r\n        color: black;\r\n        border: none;\r\n        padding: 14px 24px;\r\n        cursor: pointer;\r\n        font-size: 1.125rem;\r\n        font-weight: 500;\r\n        transition: all 0.2s;\r\n        border-radius: 4px;\r\n        min-width: 12rem;\r\n        text-align: center;\r\n        width: 100%;\r\n    }\r\n\r\n    .format-btn:is(:hover, :focus, :focus-visible, :active){\r\n        background-color: #ffa8ee; \/* Hover from #minifyBtn *\/\r\n    }\r\n\r\n    .reset-btn {\r\n        background: none;\r\n        border: none;\r\n        color: black;\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: #545454;\r\n        text-decoration: underline;\r\n    }\r\n    \r\n    \/* --- Result Display Styles --- *\/\r\n    .result-section {\r\n        margin-top: 16px;\r\n        padding: 24px;\r\n        background-color: #f7f7fc;\r\n        border-top: 1.5px solid #EBEBEB;\r\n        text-align: center;\r\n    }\r\n\r\n    .result-section p {\r\n        margin: 0 0 8px 0;\r\n        font-family: 'DM Sans', sans-serif;\r\n        font-size: 1rem;\r\n        color: #545454;\r\n    }\r\n\r\n    .result-value {\r\n        font-family: 'DM Sans', sans-serif;\r\n        font-size: 2.75rem;\r\n        font-weight: 700;\r\n        color: #05047E; \/* Matches header for consistency *\/\r\n        display: block;\r\n    }\r\n\r\n    \/* --- Responsive Adjustments --- *\/\r\n    @media (max-width: 768px) {\r\n        .cpm-calculator-app {\r\n            padding: 30px 0 0;\r\n        }\r\n        .calculator-content {\r\n            padding: 20px;\r\n        }\r\n        .section-header {\r\n            font-size: 1.1rem;\r\n            padding: 12px 20px;\r\n        }\r\n        .result-value {\r\n            font-size: 2.25rem;\r\n        }\r\n    }\r\n<\/style>\r\n\r\n<div class=\"cpm-calculator-app\">\r\n    <div class=\"calculator-container\">\r\n        <div class=\"section-header\">\r\n            Cost Per Mille (CPM) Calculator\r\n        <\/div>\r\n        <div class=\"calculator-content\">\r\n            <div class=\"input-group\">\r\n                <label for=\"totalCost\">Total Campaign Cost ($)<\/label>\r\n                <input type=\"number\" id=\"totalCost\" class=\"calculator-input\" placeholder=\"e.g., 500\" min=\"0\">\r\n            <\/div>\r\n            \r\n            <div class=\"input-group\">\r\n                <label for=\"totalImpressions\">Total Impressions<\/label>\r\n                <input type=\"number\" id=\"totalImpressions\" class=\"calculator-input\" placeholder=\"e.g., 100000\" min=\"1\">\r\n            <\/div>\r\n\r\n            <div class=\"format-btn-container\">\r\n                <button id=\"calculateCpmBtn\" class=\"format-btn\">Calculate CPM<\/button>\r\n                <button id=\"resetCpmBtn\" class=\"reset-btn\">Reset Fields<\/button>\r\n            <\/div>\r\n\r\n            <div class=\"result-section\">\r\n                <p>Your Cost Per Mille (CPM) is:<\/p>\r\n                <span id=\"cpmResult\" class=\"result-value\">$0.00<\/span>\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        \/\/ Get references to the DOM elements\r\n        const totalCostInput = document.getElementById('totalCost');\r\n        const totalImpressionsInput = document.getElementById('totalImpressions');\r\n        const calculateBtn = document.getElementById('calculateCpmBtn');\r\n        const resetBtn = document.getElementById('resetCpmBtn');\r\n        const resultDisplay = document.getElementById('cpmResult');\r\n\r\n        \/\/ Function to calculate the CPM\r\n        function calculateCPM() {\r\n            \/\/ Retrieve values and convert them to numbers\r\n            const cost = parseFloat(totalCostInput.value);\r\n            const impressions = parseFloat(totalImpressionsInput.value);\r\n\r\n            \/\/ Validate the inputs\r\n            if (isNaN(cost) || isNaN(impressions) || cost < 0 || impressions <= 0) {\r\n                resultDisplay.textContent = 'Invalid Input';\r\n                resultDisplay.style.color = '#cf2e2e'; \/\/ Use a vivid red for error\r\n                return;\r\n            }\r\n\r\n            \/\/ Calculate CPM: (Cost \/ Impressions) * 1000\r\n            const cpm = (cost \/ impressions) * 1000;\r\n            \r\n            \/\/ Format the result to two decimal places and display it\r\n            resultDisplay.textContent = `$${cpm.toFixed(2)}`;\r\n            resultDisplay.style.color = '#05047E'; \/\/ Reset color on success\r\n        }\r\n\r\n        \/\/ Function to reset the calculator\r\n        function resetCalculator() {\r\n            totalCostInput.value = '';\r\n            totalImpressionsInput.value = '';\r\n            resultDisplay.textContent = '$0.00';\r\n            resultDisplay.style.color = '#05047E'; \/\/ Reset color\r\n            totalCostInput.focus(); \/\/ Set focus to the first input for better UX\r\n        }\r\n\r\n        \/\/ Add event listeners to the buttons\r\n        calculateBtn.addEventListener('click', calculateCPM);\r\n        resetBtn.addEventListener('click', resetCalculator);\r\n        \r\n        \/\/ Optional: Allow calculation by pressing Enter in the input fields\r\n        totalCostInput.addEventListener('keydown', (event) => {\r\n            if (event.key === 'Enter') {\r\n                calculateCPM();\r\n            }\r\n        });\r\n        \r\n        totalImpressionsInput.addEventListener('keydown', (event) => {\r\n            if (event.key === 'Enter') {\r\n                calculateCPM();\r\n            }\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-8310922","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>Cost Per Mille Calculator<\/title>\n<meta name=\"description\" content=\"Easily calculate your Cost Per Mille (CPM) with our free online calculator. Understand your ad reach efficiency and optimize your digital advertising spend.\" \/>\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\/cost-per-mille-calculator\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Cost Per Mille Calculator\" \/>\n<meta property=\"og:description\" content=\"Easily calculate your Cost Per Mille (CPM) with our free online calculator. Understand your ad reach efficiency and optimize your digital advertising spend.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/elementor.com\/tools\/cost-per-mille-calculator\/\" \/>\n<meta property=\"og:site_name\" content=\"Tools\" \/>\n<meta property=\"article:published_time\" content=\"2025-09-16T06:12:11+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-09-16T06:14:36+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\/cost-per-mille-calculator\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/elementor.com\/tools\/cost-per-mille-calculator\/\"},\"author\":{\"name\":\"liz@148.red\",\"@id\":\"https:\/\/elementor.com\/tools\/#\/schema\/person\/80e8375cb95e6030bc2f897c41c985ac\"},\"headline\":\"Cost Per Mille Calculator\",\"datePublished\":\"2025-09-16T06:12:11+00:00\",\"dateModified\":\"2025-09-16T06:14:36+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/elementor.com\/tools\/cost-per-mille-calculator\/\"},\"wordCount\":6,\"keywords\":[\"Html-Css-tools\"],\"articleSection\":[\"tools\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/elementor.com\/tools\/cost-per-mille-calculator\/\",\"url\":\"https:\/\/elementor.com\/tools\/cost-per-mille-calculator\/\",\"name\":\"Cost Per Mille Calculator\",\"isPartOf\":{\"@id\":\"https:\/\/elementor.com\/tools\/#website\"},\"datePublished\":\"2025-09-16T06:12:11+00:00\",\"dateModified\":\"2025-09-16T06:14:36+00:00\",\"author\":{\"@id\":\"https:\/\/elementor.com\/tools\/#\/schema\/person\/80e8375cb95e6030bc2f897c41c985ac\"},\"description\":\"Easily calculate your Cost Per Mille (CPM) with our free online calculator. Understand your ad reach efficiency and optimize your digital advertising spend.\",\"breadcrumb\":{\"@id\":\"https:\/\/elementor.com\/tools\/cost-per-mille-calculator\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/elementor.com\/tools\/cost-per-mille-calculator\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/elementor.com\/tools\/cost-per-mille-calculator\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/elementor.com\/tools\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Cost Per Mille 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":"Cost Per Mille Calculator","description":"Easily calculate your Cost Per Mille (CPM) with our free online calculator. Understand your ad reach efficiency and optimize your digital advertising spend.","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\/cost-per-mille-calculator\/","og_locale":"en_US","og_type":"article","og_title":"Cost Per Mille Calculator","og_description":"Easily calculate your Cost Per Mille (CPM) with our free online calculator. Understand your ad reach efficiency and optimize your digital advertising spend.","og_url":"https:\/\/elementor.com\/tools\/cost-per-mille-calculator\/","og_site_name":"Tools","article_published_time":"2025-09-16T06:12:11+00:00","article_modified_time":"2025-09-16T06:14:36+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\/cost-per-mille-calculator\/#article","isPartOf":{"@id":"https:\/\/elementor.com\/tools\/cost-per-mille-calculator\/"},"author":{"name":"liz@148.red","@id":"https:\/\/elementor.com\/tools\/#\/schema\/person\/80e8375cb95e6030bc2f897c41c985ac"},"headline":"Cost Per Mille Calculator","datePublished":"2025-09-16T06:12:11+00:00","dateModified":"2025-09-16T06:14:36+00:00","mainEntityOfPage":{"@id":"https:\/\/elementor.com\/tools\/cost-per-mille-calculator\/"},"wordCount":6,"keywords":["Html-Css-tools"],"articleSection":["tools"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/elementor.com\/tools\/cost-per-mille-calculator\/","url":"https:\/\/elementor.com\/tools\/cost-per-mille-calculator\/","name":"Cost Per Mille Calculator","isPartOf":{"@id":"https:\/\/elementor.com\/tools\/#website"},"datePublished":"2025-09-16T06:12:11+00:00","dateModified":"2025-09-16T06:14:36+00:00","author":{"@id":"https:\/\/elementor.com\/tools\/#\/schema\/person\/80e8375cb95e6030bc2f897c41c985ac"},"description":"Easily calculate your Cost Per Mille (CPM) with our free online calculator. Understand your ad reach efficiency and optimize your digital advertising spend.","breadcrumb":{"@id":"https:\/\/elementor.com\/tools\/cost-per-mille-calculator\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/elementor.com\/tools\/cost-per-mille-calculator\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/elementor.com\/tools\/cost-per-mille-calculator\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/elementor.com\/tools\/"},{"@type":"ListItem","position":2,"name":"Cost Per Mille 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\/8310922","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=8310922"}],"version-history":[{"count":1,"href":"https:\/\/elementor.com\/tools\/wp-json\/wp\/v2\/posts\/8310922\/revisions"}],"predecessor-version":[{"id":8310924,"href":"https:\/\/elementor.com\/tools\/wp-json\/wp\/v2\/posts\/8310922\/revisions\/8310924"}],"wp:attachment":[{"href":"https:\/\/elementor.com\/tools\/wp-json\/wp\/v2\/media?parent=8310922"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/elementor.com\/tools\/wp-json\/wp\/v2\/categories?post=8310922"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/elementor.com\/tools\/wp-json\/wp\/v2\/tags?post=8310922"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}