ROI Calculator& E-commerce Ads
Enter ad spend, revenue, cost and orders to instantly calculate ROI, ROAS, CPA, AOV and more.
Ad Campaign Data
Ad Spend
Total advertising costRevenue
Total sales from adsProduct Cost
COGS + shipping + platform feesOrders
Total orders from adsCampaign Performance
ROI = Net Profit / Ad Spend x 100%
Did this tool solve your problem?
Code Examples
JavaScript
function calcROI(adSpend, revenue, cost) {
const profit = revenue - adSpend - cost;
const roi = (profit / adSpend) * 100;
const roas = revenue / adSpend;
return { roi, roas, profit };
}
const r = calcROI(1000, 5000, 2000);
// { roi: 200, roas: 5, profit: 2000 }Python
def calc_roi(ad_spend, revenue, cost):
profit = revenue - ad_spend - cost
roi = (profit / ad_spend) * 100
roas = revenue / ad_spend
cpa = ad_spend / orders if orders else None
return {
"roi": roi,
"roas": roas,
"profit": profit,
"cpa": cpa,
}TypeScript
interface CampaignMetrics {
roi: number; // percentage
roas: number; // ratio
profit: number;
cpa: number | null;
}
function analyze(
adSpend: number, revenue: number,
cost: number, orders: number,
): CampaignMetrics {
const profit = revenue - adSpend - cost;
return {
roi: (profit / adSpend) * 100,
roas: revenue / adSpend,
profit,
cpa: orders > 0 ? adSpend / orders : null,
};
}Go
type Metrics struct {
ROI float64
ROAS float64
Profit float64
CPA float64
}
func CalcROI(
adSpend, revenue, cost float64,
orders int,
) Metrics {
profit := revenue - adSpend - cost
m := Metrics{
ROI: profit / adSpend * 100,
ROAS: revenue / adSpend,
Profit: profit,
}
if orders > 0 {
m.CPA = adSpend / float64(orders)
}
return m
}Frequently Asked Questions
How is e-commerce ROI calculated?
E-commerce ROI = (Revenue - Ad Spend - Product Cost) / Ad Spend x 100%. For example, if you spend $1,000 on ads, generate $5,000 in sales with $2,000 in product costs, ROI = (5000-1000-2000)/1000 = 200%, meaning $2 net profit for every $1 spent on ads.
What's the difference between ROI and ROAS?
ROI (Return on Investment) measures net profit relative to investment, deducting all costs. ROAS (Return on Ad Spend) = Revenue / Ad Spend, which only looks at revenue vs ad cost without deducting product costs. ROAS > 1 means ads covered their cost, but doesn't guarantee profitability. ROI > 0 means actual profit.
What's a good ROI for e-commerce?
It varies by industry. Generally, ROI > 100% is good (earning more than $1 profit per $1 ad spend). High-margin categories (beauty, digital products) can achieve 200-500% ROI. Low-margin categories (electronics) may find 30-80% acceptable. The key is staying above your break-even point.
What does CPA mean?
CPA (Cost Per Acquisition) is the advertising cost to acquire one paying customer. CPA = Ad Spend / Number of Orders. Lower CPA means more efficient customer acquisition. Track CPA alongside ROI to optimize your ad campaigns.
What should product cost include?
Product cost should include: manufacturing/procurement cost, packaging, shipping/fulfillment, and platform fees/commissions. Don't include ad spend (calculated separately). If you have returns, use net revenue and adjusted costs for accurate calculations.
How to improve e-commerce ad ROI?
Four strategies: 1) Increase AOV (bundles, upsells, free shipping thresholds); 2) Lower ad costs (better targeting, creatives, bidding); 3) Reduce COGS (supply chain optimization); 4) Improve conversion rate (better product pages, reviews). Regularly analyze each channel's data to identify and scale high-ROI campaigns.