Cloudflare Workers Pricing Calculator
Estimate your monthly Cloudflare Workers costs.
Total number of HTTP requests your Workers will handle per month.
Average execution time of your Worker script per request in milliseconds.
Total outbound data transfer used by your Workers per month in Gigabytes.
Amount of free requests included per month. Typically 1 Million.
Average duration included in the free tier. Typically 10 ms.
Amount of free data transfer included per month. Typically 1 GB.
Cost for every 1 million requests exceeding the free tier.
Cost for every 1 million milliseconds of execution time exceeding the free tier.
Cost per Gigabyte of outbound data transfer exceeding the free tier.
Estimated Monthly Cost
0
0
0
$0.00
$0.00
$0.00
| Component | Free Tier Included | Price per Unit (after free tier) | Estimated Billable Units | Estimated Cost |
|---|---|---|---|---|
| Requests | 1 Million | $0.30 / Million | 0 | $0.00 |
| Duration (ms) | 10 ms | $2.00 / Million ms | 0 | $0.00 |
| Data Transfer (GB) | 1 GB | $0.01 / GB | 0 | $0.00 |
| Total Estimated Cost | $0.00 | |||
Duration Cost
Data Transfer Cost
What is Cloudflare Workers Pricing?
Cloudflare Workers pricing refers to the cost structure associated with using Cloudflare’s serverless compute platform. Cloudflare Workers allows developers to run JavaScript, WebAssembly, and other code directly at the edge of Cloudflare’s global network, close to end-users. This proximity enables low-latency applications, dynamic content generation, and sophisticated request routing. Understanding the pricing model is crucial for optimizing costs and ensuring predictable expenses for your edge computing applications.
Who should use it?
- Businesses and developers looking to build high-performance, low-latency applications.
- Teams needing to run dynamic logic at the edge for tasks like A/B testing, authentication, or content personalization.
- Companies aiming to reduce origin server load by handling requests at the edge.
- Anyone seeking a cost-effective way to run code without managing servers.
Common misconceptions about Cloudflare Workers pricing:
- “It’s always free.” While Cloudflare Workers offers a generous free tier, significant usage will incur costs. Understanding the limits of the free tier and the cost per unit beyond it is vital.
- “It’s too complex to estimate.” While there are multiple components, with a calculator like this one, estimating costs becomes straightforward.
- “Cost is only about requests.” Pricing involves requests, compute duration, and data transfer, each with its own cost structure.
Cloudflare Workers Pricing Formula and Mathematical Explanation
The pricing for Cloudflare Workers is primarily based on three core components: the number of requests, the duration of script execution, and the amount of data transferred. Cloudflare provides a free tier for each of these components, and charges apply to usage that exceeds these limits.
Core Formula:
Total Cost = (Request Cost) + (Duration Cost) + (Data Transfer Cost)
Where each component cost is calculated as follows:
1. Request Cost:
Request Cost = MAX(0, (Total Requests - Free Tier Requests)) * (Price per Million Requests / 1,000,000)
2. Duration Cost:
Duration Cost = MAX(0, (Total Duration in ms - Free Tier Duration in ms)) * (Price per Million ms / 1,000,000)
3. Data Transfer Cost:
Data Transfer Cost = MAX(0, (Total Data Transfer in GB - Free Tier Data Transfer in GB)) * (Price per GB)
The MAX(0, ...) function ensures that costs are not negative if usage falls within the free tier.
Variable Explanations:
| Variable | Meaning | Unit | Typical Range |
|---|---|---|---|
| Total Requests | The total number of HTTP requests processed by your Workers per month. | Requests | 100,000 – 10,000,000+ |
| Free Tier Requests | The number of requests included for free each month. | Requests | 1,000,000 |
| Price per Million Requests | The cost for every million requests beyond the free tier allowance. | USD / 1 Million Requests | $0.30 |
| Total Duration in ms | The sum of the execution time for all requests processed by your Workers per month. | Milliseconds (ms) | 10,000 – 1,000,000+ |
| Free Tier Duration in ms | The amount of execution time included for free each month. | Milliseconds (ms) | 10 |
| Price per Million ms | The cost for every million milliseconds of execution time beyond the free tier allowance. | USD / 1 Million ms | $2.00 |
| Total Data Transfer in GB | The total volume of data transferred outbound from Cloudflare’s edge to the end-user per month. | Gigabytes (GB) | 0.1 – 10+ |
| Free Tier Data Transfer in GB | The amount of data transfer included for free each month. | Gigabytes (GB) | 1 |
| Price per GB | The cost per Gigabyte of data transferred outbound beyond the free tier allowance. | USD / GB | $0.01 |
| Billable Requests | Requests exceeding the free tier. | Requests | 0+ |
| Billable Duration (ms) | Execution duration exceeding the free tier. | Milliseconds (ms) | 0+ |
| Billable Data Transfer (GB) | Data transfer exceeding the free tier. | Gigabytes (GB) | 0+ |
Practical Examples (Real-World Use Cases)
Example 1: A Small Blog with Dynamic Content
Scenario: A personal blog using Cloudflare Workers to serve personalized content based on user location and to handle form submissions. The blog receives moderate traffic.
Inputs:
- Monthly Requests: 1,500,000
- Average Request Duration: 15 ms
- Monthly Data Transfer: 2 GB
- Free Tier Requests: 1,000,000
- Free Tier Duration: 10 ms
- Free Tier Data Transfer: 1 GB
- Price per Million Requests: $0.30
- Price per Million ms: $2.00
- Price per GB: $0.01
Calculation Breakdown:
- Billable Requests: MAX(0, 1,500,000 – 1,000,000) = 500,000
- Billable Duration: MAX(0, (1,500,000 requests * 15 ms/request) – (1,000,000 requests * 10 ms/request)) = MAX(0, 22,500,000 ms – 10,000,000 ms) = 12,500,000 ms
- Billable Data Transfer: MAX(0, 2 GB – 1 GB) = 1 GB
- Requests Cost: (500,000 / 1,000,000) * $0.30 = 0.5 * $0.30 = $0.15
- Duration Cost: (12,500,000 ms / 1,000,000) * $2.00 = 12.5 * $2.00 = $25.00
- Data Transfer Cost: 1 GB * $0.01/GB = $0.01
Total Estimated Cost: $0.15 + $25.00 + $0.01 = $25.16
Interpretation: Even with a modest amount of overage, the compute duration is the primary cost driver. Optimizing the Worker’s execution time could significantly reduce the bill.
Example 2: An E-commerce API Gateway
Scenario: An e-commerce platform uses Cloudflare Workers as an API gateway to handle incoming API requests, perform authentication checks, and route requests to different backend services. This involves a high volume of requests and significant data transfer.
Inputs:
- Monthly Requests: 50,000,000
- Average Request Duration: 8 ms
- Monthly Data Transfer: 50 GB
- Free Tier Requests: 1,000,000
- Free Tier Duration: 10 ms
- Free Tier Data Transfer: 1 GB
- Price per Million Requests: $0.30
- Price per Million ms: $2.00
- Price per GB: $0.01
Calculation Breakdown:
- Billable Requests: MAX(0, 50,000,000 – 1,000,000) = 49,000,000
- Billable Duration: MAX(0, (50,000,000 requests * 8 ms/request) – (1,000,000 requests * 10 ms/request)) = MAX(0, 400,000,000 ms – 10,000,000 ms) = 390,000,000 ms
- Billable Data Transfer: MAX(0, 50 GB – 1 GB) = 49 GB
- Requests Cost: (49,000,000 / 1,000,000) * $0.30 = 49 * $0.30 = $14.70
- Duration Cost: (390,000,000 ms / 1,000,000) * $2.00 = 390 * $2.00 = $780.00
- Data Transfer Cost: 49 GB * $0.01/GB = $0.49
Total Estimated Cost: $14.70 + $780.00 + $0.49 = $795.19
Interpretation: For high-traffic applications, compute duration remains the most significant cost factor, even with efficient code. Data transfer costs are relatively low in this scenario but can add up for media-heavy applications. Understanding these Cloudflare Workers pricing factors is key.
How to Use This Cloudflare Workers Pricing Calculator
This calculator is designed to provide a quick and easy estimate of your potential Cloudflare Workers costs. Follow these steps:
- Enter Monthly Requests: Input the total number of HTTP requests your Workers are expected to handle in a month.
- Input Average Request Duration: Estimate the average execution time in milliseconds (ms) for a single request to complete within your Worker script. Be realistic – use profiling data if available.
- Specify Monthly Data Transfer: Enter the total amount of data (in Gigabytes, GB) that your Workers will send outbound to users per month.
- Review Free Tier Details: The calculator defaults to the standard Cloudflare Workers free tier (1 Million requests, 10ms duration, 1GB data transfer). Adjust these if you have a specific plan or are aware of different allowances.
- Input Usage-Based Prices: Enter the costs per million requests, per million milliseconds, and per GB of data transfer. These are the prices applied after you exceed the free tier. The calculator defaults to standard pricing.
- Click “Calculate Costs”: The calculator will instantly update the results section.
How to Read Results:
- Primary Highlighted Result: This is your estimated total monthly cost in USD.
- Intermediate Values: These show the “Billable Requests”, “Billable Duration (ms)”, and “Billable Data Transfer (GB)” – the amounts that fall outside the free tier and are subject to charges.
- Component Costs: See the estimated cost breakdown for requests, duration, and data transfer.
- Table: Provides a detailed breakdown matching the results, showing free tier allowances, unit prices, billable units, and costs per component.
- Chart: Visually represents the cost contribution of each component (Requests, Duration, Data Transfer).
Decision-Making Guidance:
Use the results to:
- Budgeting: Forecast your monthly spend on Cloudflare Workers.
- Optimization: Identify which component (requests, duration, data transfer) is driving the most cost. Focus optimization efforts there. For example, if duration cost is high, look for ways to make your Worker script more efficient.
- Scaling: Understand how costs will change as your application traffic grows. This helps in planning for future infrastructure needs.
- Comparing Services: Evaluate the cost-effectiveness of Cloudflare Workers against other edge computing or serverless platforms.
Key Factors That Affect Cloudflare Workers Pricing Results
Several factors significantly influence your Cloudflare Workers bill. Understanding these can help you manage and optimize your spending:
-
Request Volume:
Financial Reasoning: This is often the most direct cost driver. Every incoming request, even those that are very short-lived, incurs a baseline cost (or uses free tier allowance). Higher traffic means more requests, potentially pushing you beyond the free tier thresholds faster.
-
Compute Duration (Execution Time):
Financial Reasoning: This is a critical cost factor, especially for complex Workers. The longer your script runs per request, the more CPU time it consumes. Cloudflare charges based on total milliseconds executed beyond the free tier. Inefficient code, heavy computations, or slow external API calls within your Worker directly increase this cost.
-
Data Transfer Volume:
Financial Reasoning: While often less expensive per GB than compute duration, data transfer costs can accumulate rapidly for applications serving large files, streaming video/audio, or handling high-resolution images. This cost applies to data sent from Cloudflare’s edge to the end-user. Inbound data transfer is generally free.
-
Free Tier Usage:
Financial Reasoning: The generous free tier significantly impacts the final bill for low-usage applications. Effectively utilizing the free tier means no charges apply until you exceed its limits. Understanding these limits is paramount for cost estimation.
-
Pricing Tier / Specific Plan:
Financial Reasoning: While standard pricing is shown, specific enterprise agreements or custom plans might have different rates. Always confirm the exact pricing applicable to your account. For most users, the standard on-demand pricing applies.
-
Worker Efficiency and Optimization:
Financial Reasoning: This ties into duration and data transfer. Well-optimized Workers run faster (reducing duration costs) and transfer only necessary data (reducing transfer costs). Poorly optimized code can lead to unexpectedly high bills, similar to how inefficient code in a traditional serverless function could inflate costs.
-
Number of Workers and Routes:
Financial Reasoning: While not directly priced per Worker instance, having multiple Workers handling different tasks or complex routing rules can increase the overall request volume and potentially the aggregated duration and data transfer, indirectly affecting the total cost.
Frequently Asked Questions (FAQ)