CPC CPM calculator
Enter spend, clicks and impressions from one reporting window and get both unit prices at once: 100 of spend on 50 clicks and 10000 impressions is a CPC of 2 and a CPM of 10. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Spend
- 100
- Clicks
- 50
- Impressions
- 10,000
- Cpc
- 2
- Cpm
- 10
Cost per click (CPC) and cost per mille (CPM) are the two unit prices paid-media teams read first when they compare campaigns. CPC is total ad spend divided by the number of clicks; CPM is total ad spend divided by impressions, then multiplied by one thousand so the figure is a price per thousand impressions. This calculator takes those three counts — spend, clicks, and impressions — and returns both metrics from the same window so a dashboard and a billing sheet never disagree.
What CPC and CPM measure and how the ratios are formed
Cost per click is the average amount paid for each click in a reporting window: total ad spend divided by the click count. Mille is Latin for thousand; publishers and ad servers have used CPM as the display-inventory unit price for decades, while search and performance campaigns usually bid and report in CPC. One hundred dollars of spend on fifty clicks is a CPC of two; the same one hundred dollars on ten thousand impressions is a CPM of ten.
Those two identities are independent: a campaign can look cheap on CPM and expensive on CPC if the click-through rate is low, or the reverse if the creative earns many clicks from few impressions. Zero spend with positive clicks and impressions is a legitimate outcome — you paid nothing, so both unit prices are zero. What is not legitimate is a zero click count or a zero impression count, because dividing spend by zero does not produce a cost per click or a cost per mille.
Negative spend, negative clicks, and negative impressions are rejected as well. Rates are rounded half-up to six decimal places so goldens stay byte-stable across runtimes, and the echoed counts are the finite numbers you sent.
Where a CPC and CPM calculator earns its keep
Media buyers use a CPC CPM calculator when a campaign, a placement, or a locale is accused of being expensive: they already have spend, clicks, and impressions in a sheet and need the same unit prices their ad server would print, without waiting on a UI export. Agencies re-run the three counts per creative and per device so a weekly deck can compare cpc and cpm across variants with one shared rounding rule. Failed validation does not consume balance.
Keep clicks and impressions strictly positive, keep spend non-negative, pin the rounded unit prices in tests, and you get reproducible cost per click and cost per mille for dashboards, LMS plugins, and edge workers without standing up an ads engine of your own.
What you can do with it
Campaign unit-price checks
Turn a week's spend, clicks, and impressions into CPC and CPM you can put next to the campaign in a media review.
Creative and placement comparison
Recompute cpc and cpm per ad, locale, or device from three warehouse counts so every variant shares the same unit prices and rounding.
FAQ
What happens if clicks or impressions are zero?
CPC is undefined when clicks are zero and CPM is undefined when impressions are zero; the failure is not billed.
Can spend be zero?
Yes. Zero spend with positive clicks and impressions returns cpc and cpm of zero.
Is CPM the same as cost per thousand impressions?
Yes. Mille means thousand. CPM is spend divided by impressions, then multiplied by one thousand, so the figure is a price per thousand impressions.
How do I calculate CPC and CPM for the same campaign?
Divide spend by clicks for the CPC. For the CPM, divide spend by impressions and multiply by one thousand. With 100 of spend, 50 clicks and 10000 impressions, you get 2 and 10.
Why can a campaign look cheap on CPM but expensive on CPC?
Because the two prices are independent. If few people click, each thousand views stays cheap while each click costs a lot; an ad that earns many clicks from few views shows the reverse.
Related tools
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/fin/cpc-cpm \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"spend":100,"clicks":50,"impressions":10000}'const res = await fetch("https://api.kit.forhosting.com/fin/cpc-cpm", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"spend": 100,
"clicks": 50,
"impressions": 10000
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/fin/cpc-cpm",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"spend": 100,
"clicks": 50,
"impressions": 10000
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/fin/cpc-cpm", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"spend":100,"clicks":50,"impressions":10000}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"spend":100,"clicks":50,"impressions":10000}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/fin/cpc-cpm", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"spend": 100,
"clicks": 50,
"impressions": 10000
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "fin.cpc_cpm",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
Technical notes
When clicks or impressions are zero the corresponding ratio is undefined, so the task fails with invalid_input and is not billed.
What CPC and CPM measure and how the ratios are formed
Cost per mille is the average amount paid for every one thousand impressions: total ad spend divided by impressions, then multiplied by one thousand. This endpoint does not ingest a raw auction log, does not convert currencies, and does not apply media-network fees or taxes. It prices and returns the textbook ratios on three numbers you already have from an ad-server export, a warehouse, or a weekly sheet.
Input contract, response shape, and error behaviour
On success the body echoes spend, clicks, and impressions, then reports cpc as spend divided by clicks, cpm as spend divided by impressions times one thousand, and a formula string restating both identities. Example: one hundred of spend, fifty clicks, and ten thousand impressions yield cpc two and cpm ten. POST a JSON body with three required finite numbers. spend is total ad spend in the reporting window, in one currency unit; aliases ad_spend, total_spend, total_ad_spend, and cost map to the same field so a warehouse column can keep its name. clicks is the click count in that same window; aliases click_count and click are accepted. impressions is the impression count; aliases imps, impression_count, and impression are accepted. Each field may arrive as a JSON number or as a numeric string. Missing fields, empty strings, and non-finite values fail with invalid_input naming the field. If impressions is zero or negative the request fails with a message that CPM is undefined when impressions are zero. If spend is negative the request fails. Those failures are not billed. Pair the JSON with your own date grain if you need a weekly series; this endpoint computes one window at a time and does not emit charts.
Where a CPC and CPM calculator earns its keep
Finance partners who allocate paid-media spend against unit cost drop spend, clicks, and impressions from the warehouse and pin both metrics in a model that must not call a proprietary ads API. This is a different search and a different job from computing bounce rate or cost per use: those ratios use sessions or expected uses in the denominator, while CPC and CPM use clicks and impressions against total ad spend.
Integration use cases
Paid-media cost models
Pin CPC and CPM in a spend-allocation sheet without calling a proprietary ads API for ratios you already have the inputs for.
Technical questions
How are CPC and CPM calculated?
Send finite numbers spend, clicks, and impressions. The API returns cpc = spend / clicks and cpm = (spend / impressions) × 1000.
What does the CPC CPM calculator cost?
The browser tool is free. API requests use prepaid KIT balance at $0.002 per successful call; invalid input is not billed.