You run an online store. Last month 10,000 people visited your website. At the end of the month you check your sales dashboard and see that 350 of those visitors actually made a purchase. Were those numbers good? Were they terrible? Was your marketing working or was most of your traffic bouncing without doing anything useful?
Without a single calculation you cannot answer any of those questions. With one calculation you can answer all of them and start making decisions based on something real instead of gut feeling.
That calculation is the conversion rate. It is one of the most widely used metrics in digital marketing, ecommerce, product analytics, and sales. It tells you what percentage of the people who took a first action, visiting your site, clicking an ad, opening an email, went on to complete the action you actually wanted them to complete.
This guide explains what conversion rate is, how to calculate it, what a good rate looks like across different industries, and how to apply the formula in real scenarios including Python calculations for analysts who want to automate the process.
What Is Conversion Rate?
Conversion rate is the percentage of users who completed a desired action out of the total number of users who had the opportunity to complete it. It answers the question: out of everyone who could have done the thing I wanted, how many actually did it?
The desired action, called a conversion, depends entirely on what you are measuring. For an ecommerce store a conversion is a purchase. For a newsletter it is a signup. For a SaaS product it is a free trial activation. For a landing page it is a form submission. For a sales team it is a closed deal.
A simple analogy. Imagine a street vendor sets up a table and 200 people walk past. Forty of them stop to look. Twelve of them buy something. The vendor has two conversion rates worth tracking. The stop rate is 40 out of 200, which is 20 percent. The purchase rate among people who stopped is 12 out of 40, which is 30 percent. Each rate measures a different stage of the same journey, and both reveal something useful about where things are working and where they are not.
The Conversion Rate Formula
The formula is straightforward:
Conversion Rate = (Number of Conversions / Total Number of Visitors) x 100
The result is a percentage. If 500 people visited your landing page and 25 of them filled out the contact form, your conversion rate is (25 / 500) x 100 which equals 5 percent.
That is the entire formula. What changes across different use cases is what you count as a conversion and what you count as total visitors or opportunities. Getting those two numbers right for your specific situation is where most of the real thinking happens.
Step by Step: Calculating Conversion Rate With Real Examples
Example 1: Ecommerce Store Purchase Conversion Rate
An online clothing store had 15,000 website visitors in April. Of those, 420 completed a purchase.
Conversion Rate = (420 / 15,000) x 100
Conversion Rate = 0.028 x 100
Conversion Rate = 2.8%
This means 2.8 percent of visitors converted into paying customers. For ecommerce, average conversion rates typically sit between 1 and 4 percent depending on the industry and traffic source, so 2.8 percent is a reasonable result for a general clothing store.
Example 2: Email Marketing Campaign
A business sent a promotional email to 8,000 subscribers. The email contained a link to a product page. 640 subscribers clicked the link.
Conversion Rate = (640 / 8,000) x 100
Conversion Rate = 0.08 x 100
Conversion Rate = 8%
Here the conversion is a click, not a purchase. The total is the number of emails delivered, not website visitors. Defining both numbers correctly for the specific campaign is what makes the metric meaningful. An 8 percent click-through rate on a promotional email is strong performance by most industry benchmarks.
Example 3: Lead Generation Landing Page
A SaaS company ran a paid ad campaign that sent 3,200 people to a landing page offering a free ebook download in exchange for an email address. 576 people submitted the form.
Conversion Rate = (576 / 3,200) x 100
Conversion Rate = 0.18 x 100
Conversion Rate = 18%
An 18 percent conversion rate on a lead generation page is excellent. The lower the friction of the conversion action, meaning a free download requires less commitment than a purchase, the higher the conversion rate you should expect to see.
Example 4: Sales Team Close Rate
A sales team had 90 qualified leads enter the pipeline in Q1. They closed 27 of them into paying customers.
Conversion Rate = (27 / 90) x 100
Conversion Rate = 0.3 x 100
Conversion Rate = 30%
In a sales context this is called the close rate rather than the conversion rate, but the formula is identical. A 30 percent close rate from qualified leads is solid performance for most B2B sales teams.
Calculating Conversion Rate in Python
For analysts working with data at scale, automating the calculation in Python saves significant time and makes it easy to track conversion rates across multiple campaigns, time periods, or product categories at once.
Basic calculation:
python
def conversion_rate(conversions, total_visitors):
if total_visitors == 0:
return 0
return round((conversions / total_visitors) * 100, 2)
visitors = 15000
purchases = 420
rate = conversion_rate(purchases, visitors)
print(f"Conversion Rate: {rate}%")
Output:
Conversion Rate: 2.8%
Calculating conversion rates across multiple campaigns:
python
import pandas as pd
data = {
'campaign': ['Email April', 'Paid Search', 'Organic', 'Social Media', 'Referral'],
'visitors': [8000, 12000, 25000, 6500, 3200],
'conversions': [640, 480, 875, 195, 224]
}
df = pd.DataFrame(data)
df['conversion_rate'] = round((df['conversions'] / df['visitors']) * 100, 2)
df = df.sort_values('conversion_rate', ascending=False)
print(df)
Output:
campaign visitors conversions conversion_rate
4 Referral 3200 224 7.00
0 Email April 8000 640 8.00
2 Organic 25000 875 3.50
1 Paid Search 12000 480 4.00
3 Social Media 6500 195 3.00
This kind of comparison immediately shows you which traffic source converts best and which needs attention. Referral and email traffic outperform paid search and social media in this example, which would suggest reallocating budget toward referral programs and email nurture sequences.
Tracking conversion rate over time:
python
import pandas as pd
monthly_data = {
'month': ['January', 'February', 'March', 'April', 'May', 'June'],
'visitors': [10000, 11200, 9800, 15000, 14200, 16800],
'conversions': [280, 336, 265, 420, 440, 571]
}
df = pd.DataFrame(monthly_data)
df['conversion_rate'] = round((df['conversions'] / df['visitors']) * 100, 2)
print(df[['month', 'visitors', 'conversions', 'conversion_rate']])
print(f"\nAverage conversion rate: {df['conversion_rate'].mean().round(2)}%")
print(f"Best month: {df.loc[df['conversion_rate'].idxmax(), 'month']}")
print(f"Worst month: {df.loc[df['conversion_rate'].idxmin(), 'month']}")
Tracking month over month like this lets you spot trends, measure the impact of changes to your site or campaigns, and identify seasonal patterns in your conversion performance.
What Is a Good Conversion Rate?
There is no single answer because a good conversion rate depends entirely on what you are measuring and which industry you are in. These are general benchmarks across common use cases:
| Context | Average Conversion Rate | Strong Performance |
|---|---|---|
| Ecommerce (general) | 1% to 3% | Above 4% |
| Email click-through rate | 2% to 5% | Above 8% |
| Lead generation landing page | 5% to 15% | Above 20% |
| SaaS free trial signup | 2% to 5% | Above 8% |
| B2B sales close rate | 20% to 30% | Above 35% |
| Google Ads (search) | 3% to 6% | Above 10% |
| Add to cart rate (ecommerce) | 8% to 12% | Above 15% |
The most useful benchmark is not an industry average but your own historical performance. A conversion rate of 2 percent is bad if yours was 4 percent last quarter and good if yours was 1 percent six months ago. Track your own rate consistently over time and focus on improving it relative to your own baseline.
Common Limitations
Conversion rate ignores revenue per conversion. A campaign with a 5 percent conversion rate and an average order value of 20 dollars generates less revenue than a campaign with a 2 percent conversion rate and an average order value of 200 dollars. Always look at conversion rate alongside revenue metrics, not in isolation.
High traffic from low quality sources inflates the denominator. If you run a broad ad campaign that brings in thousands of visitors who were never going to buy, your conversion rate drops even if the underlying product and checkout experience improved. Always segment conversion rates by traffic source before drawing conclusions.
Short time windows produce unreliable rates. A conversion rate calculated over three days with 50 visitors is statistically meaningless. Small sample sizes produce wildly variable rates. Make sure you have enough data before acting on a conversion rate figure. A minimum of a few hundred visitors per segment is a reasonable starting point.
Common Mistakes to Avoid
Counting the wrong thing as a conversion. If your goal is revenue but you measure page views as conversions, you will optimize for the wrong outcome entirely. Define what a conversion actually means for your specific business goal before calculating anything.
Comparing conversion rates across completely different contexts. A 3 percent conversion rate for a luxury goods ecommerce store and a 3 percent conversion rate for a newsletter signup form are not comparable at all. The friction, price point, and intent behind each action are completely different. Only compare rates for the same type of conversion action.
Ignoring the denominator. A conversion rate can rise simply because you started getting less traffic, not because more people are converting. Always look at both the rate and the raw numbers together. A rising conversion rate alongside falling visitor numbers is a warning sign, not a win.
Making changes and measuring too quickly. If you update a landing page and check the conversion rate after 48 hours with 100 visitors, the result tells you nothing reliable. Give experiments enough time and traffic to produce statistically meaningful results before drawing conclusions.
Conversion Rate Cheat Sheet
| Task | Formula or Code |
|---|---|
| Basic conversion rate | (Conversions / Visitors) x 100 |
| Python single calculation | round((conversions / visitors) * 100, 2) |
| Pandas column calculation | df[‘rate’] = (df[‘conversions’] / df[‘visitors’]) * 100 |
| Best performing segment | df.loc[df[‘conversion_rate’].idxmax()] |
| Average rate across campaigns | df[‘conversion_rate’].mean() |
| Month over month change | df[‘rate’].pct_change() * 100 |
| Handle zero division | if total == 0: return 0 |
| Sort by best rate | df.sort_values(‘conversion_rate’, ascending=False) |
Conversion rate is one of the simplest metrics to calculate and one of the most powerful to track consistently. The formula never changes. What changes is your ability to ask the right questions about which conversions to measure, which traffic sources to segment by, and what timeframe gives you enough data to trust the result.
Start by defining what a conversion means for your specific goal. Calculate the rate using total conversions divided by total visitors multiplied by 100. Track it over time across different channels and campaigns. Look for the segments where your rate is strongest and understand why, then apply those insights to the segments where it is weakest.
The Python examples in this guide make it easy to automate that tracking across dozens of campaigns at once, so you spend less time calculating and more time acting on what the numbers are telling you.
A rising conversion rate with stable or growing traffic is one of the clearest signals that something you changed is actually working. That signal is worth measuring every single week.
FAQs
What is the formula for conversion rate?
The formula is: Conversion Rate = (Number of Conversions / Total Number of Visitors) x 100. The result is expressed as a percentage. What counts as a conversion and what counts as total visitors depends on the specific goal you are measuring.
What is a good conversion rate for an ecommerce website?
Average ecommerce conversion rates typically fall between 1 and 3 percent. Anything above 4 percent is generally considered strong performance, though this varies significantly by industry, product price point, and traffic source quality.
How do I calculate conversion rate in Python?
Divide the number of conversions by the total number of visitors and multiply by 100. In Python: round((conversions / visitors) * 100, 2). For a DataFrame with multiple campaigns use: df[‘conversion_rate’] = (df[‘conversions’] / df[‘visitors’]) * 100.
Why is my conversion rate dropping even though sales are increasing?
If your visitor numbers are growing faster than your conversions, the rate drops even when absolute sales increase. This often happens when a new traffic source brings in large volumes of lower intent visitors. Segment your conversion rate by traffic source to identify which channels are performing and which are diluting your overall rate.
What is the difference between conversion rate and click through rate?
Click through rate measures how many people clicked a link out of everyone who saw it, typically used for emails and ads. Conversion rate measures how many people completed a desired action out of everyone who had the opportunity, typically used for purchases, signups, and form submissions. Both use the same formula but measure different stages of the user journey.