AWS Lambda Pricing: How It Works and What You Pay

8 min read

Amnic

Amnic

AWS

Table of Contents

No headings found on page

AWS Lambda charges you for two things: the number of times your function runs and how long each run takes, measured against the memory you assign it. There are no servers to reserve and no hourly instance fee. You pay $0.20 per 1 million requests and $0.0000166667 per GB-second of compute on x86, after a free tier that covers 1 million requests and 400,000 GB-seconds every month, as set out on the AWS Lambda pricing page.

That model is what makes serverless computing attractive for spiky, event-driven work. It is also what makes the bill hard to predict. Lambda looks almost free at a small scale, then grows in ways most teams do not model until the invoice arrives. This guide breaks down exactly how the price is built, shows you the math on real workloads, and flags the charges that turn a $10 estimate into a much larger bill.

How AWS Lambda pricing works

Lambda billing has two core components:

  • Requests: Every invocation counts as one request, whether it succeeds, fails, or retries. After the free tier, requests cost $0.20 per million.

  • Duration: This is where most of the cost sits. Lambda measures how long your code runs, rounded to the millisecond, and multiplies that by the memory you allocated. The unit is the GB-second: one gigabyte of memory held for one second. On x86 you pay $0.0000166667 per GB-second in us-east-1, the rate published on the official pricing schedule.

Memory is the lever that controls both speed and price. When you raise a function's memory, AWS raises its CPU proportionally, so the function finishes faster. A function set to 128 MB and one set to 512 MB can cost nearly the same per run, because the 512 MB version runs roughly four times faster. Underpowered memory is a common reason Lambda bills run higher than they should.

The full formula looks like this:

Total compute = (memory in GB) x (duration in seconds) x (number of invocations) x (GB-second price)

Add the request charge on top, then layer on the extra services Lambda pulls in, which we cover further down. If your functions sit alongside containers, the same per-second thinking applies to ECS and EKS workloads too.

The AWS Lambda free tier

The free tier is generous and, unlike most AWS free tiers, it does not expire after 12 months. Every month you get 1 million requests and 400,000 GB-seconds of compute, shared across all your functions on both x86 and Graviton2, per the AWS free tier terms.

In practice, 400,000 GB-seconds covers a lot of light workloads. A function at 512 MB running 200 ms per call can serve roughly 4 million invocations a month before duration charges begin. Side projects and internal tools often stay free indefinitely. The free tier disappears fast, though, once a function carries production traffic at higher memory.

How to calculate your Lambda bill

The fastest way to understand the pricing is to run the numbers on two workloads.

Example 1: a small API backend: 5 million requests a month, 512 MB memory, 200 ms average duration, x86.

  • Requests: 5M minus 1M free = 4M billable, at $0.20 per million = $0.80

  • Compute: 0.5 GB x 0.2 s = 0.1 GB-second per call. Across 5M calls = 500,000 GB-seconds. Subtract 400,000 free = 100,000 billable, at $0.0000166667 = $1.67

  • Total: about $2.47 a month

At this scale, Lambda is close to free and requests barely register.

Example 2: a busy production service: 50 million requests a month, 1024 MB memory, 300 ms average duration, x86.

  • Requests: 49M billable at $0.20 per million = $9.80

  • Compute: 1 GB x 0.3 s = 0.3 GB-second per call. Across 50M calls = 15,000,000 GB-seconds. Subtract 400,000 free = 14,600,000 billable, at $0.0000166667 = $243.33

  • Total: about $253 a month before any extra services

Two patterns stand out. Requests are almost never the problem. Duration, driven by memory and runtime, is where the bill is decided. And the published rates only describe Lambda itself, which is rarely the whole story.

Memory, CPU, and the Graviton discount

Lambda runs on two processor architectures, and the choice affects price. Functions on Arm-based Graviton2 cost less per GB-second than the x86 equivalent, around $0.0000133334 in the first tier, and AWS rates them at up to 34 percent better price-performance on the same pricing schedule.

Run the busy service from Example 2 on Graviton and the 14,600,000 billable GB-seconds cost about $194.67 instead of $243.33, a saving near 20 percent for a one-line configuration change. Most functions written in interpreted languages move to Arm with no code changes, which makes this one of the cleanest savings in Lambda.

The hidden costs that inflate your bill

Here is the part the pricing page does not lead with: the Lambda line item is often a minority of your serverless spend. Independent analyses of real serverless bills put Lambda compute at only 20 to 40% of the total, with the rest coming from the services Lambda triggers. The usual culprits:

  • CloudWatch Logs: Every invocation writes logs, and there is no Lambda-specific free tier for them. Ingestion runs from $0.50 per GB down to $0.05 per GB at high volume, so a verbose function can quietly add tens of dollars a month, as one detailed Lambda cost breakdown documents. If you are new to the service, our explainer on what CloudWatch is covers how that logging works.

  • NAT Gateway: A function placed in a VPC that calls the public internet routes through a NAT Gateway at $0.045 per GB, a charge teams almost never forecast.

  • API Gateway: Most Lambda functions sit behind a gateway, and that traffic is billed separately. See the full breakdown in our guide to AWS API Gateway pricing.

  • Data transfer: Outbound traffic and cross-region calls carry their own per-GB rates on top of compute.

  • Provisioned Concurrency: Keeping functions pre-warmed to avoid cold starts adds $0.0000041667 per GB-second to hold the capacity, plus duration while it is enabled, as listed in the Lambda pricing details.

  • Ephemeral storage: The first 512 MB of /tmp is included; beyond that you pay $0.0000000309 per GB-second.

  • Lambda@Edge: Functions you run at CloudFront edge locations carry their own request and duration rates, higher than standard Lambda.

The takeaway: a function you modeled at $10 can bill at $50 or more once logging, gateways, and networking are counted. The only reliable way to see the true number is cost attribution that groups all of these under a single workload rather than scattering them across services.

AWS Lambda vs EC2 cost

The most common pricing question is whether Lambda beats a plain server. The honest answer is that it depends on utilization. Lambda charges nothing when idle, so it wins decisively for spiky, low-duty workloads where an instance would sit mostly unused. Once traffic is steady and functions run for long stretches, a right-sized server often costs less, because you stop paying the per-invocation premium.

If your workload is predictable and always on, compare the math against AWS EC2 pricing before committing. It also helps to understand what Elastic Compute Cloud actually charges for, since the EC2 model bills capacity by the hour rather than by the invocation.

How to reduce AWS Lambda costs

A few levers do most of the work:

  • Tune memory first: Test each function across memory settings. Moving from 128 MB to 512 MB frequently cuts total cost 30 to 40 percent because the function runs faster, a pattern documented across real-world bill teardowns.

  • Move to Graviton: The Arm rate trims roughly 20 percent off duration for most runtimes.

  • Control your logs: Drop log verbosity in production and set CloudWatch retention so old logs stop accumulating storage charges.

  • Avoid needless VPC placement: Keep functions out of a VPC unless they truly need private resources, and use VPC endpoints instead of a NAT Gateway when they do.

  • Commit where usage is steady: Compute Savings Plans cut up to 17 percent off Lambda duration for a one or three year commitment. Weigh that against the alternatives in our breakdown of AWS Savings Plans vs Reserved Instances.

For the broader practice of governing serverless spend, see our walkthrough on FinOps for serverless, and a wider toolset comparison in AWS cost optimization tools.

Bringing the full picture together

AWS Lambda pricing is simple to state and hard to predict, because the headline rates describe only part of what you pay. The discipline that keeps it under control is visibility: seeing requests, duration, logs, gateways, and transfer as one workload cost rather than scattered line items. 

Amnic gives engineering and finance teams that single view, attributing every Lambda-driven charge back to the team and feature that caused it, surfacing spikes early through anomaly detection before they reach the invoice, and projecting where spend is headed with cost forecasting

Current pricing as of 2026 is summarized above, but rates and free-tier terms can change, so always confirm against the official AWS page before you budget.

Frequently Asked Questions

Is AWS Lambda free?

Lambda has an always-free tier of 1 million requests and 400,000 GB-seconds of compute every month, and it does not expire after a year. Light workloads can stay free indefinitely, but production traffic at higher memory quickly moves you into paid usage.

How is AWS Lambda billed?

Lambda bills on two components: $0.20 per million requests and a duration charge measured in GB-seconds, which is your allocated memory multiplied by run time. Memory and execution time drive almost all of the cost, while requests stay cheap.

What is a GB-second in Lambda pricing?

A GB-second is one gigabyte of memory used for one second of execution. Lambda multiplies the memory you assign by how long the function runs, so a 512 MB function running 2 seconds uses 1 GB-second per invocation.

Is AWS Lambda cheaper than EC2?

It depends on utilization. Lambda is cheaper for spiky, low-traffic workloads because you pay nothing when idle. For steady, always-on workloads, a right-sized EC2 instance usually costs less than Lambda's per-invocation pricing.

Why is my Lambda bill higher than expected?

Lambda compute is often only 20 to 40 percent of a serverless bill. CloudWatch Logs, NAT Gateway traffic, API Gateway, and data transfer make up the rest, and these are billed separately from the Lambda rates you modeled.

Does the Lambda free tier expire?

No. Unlike most AWS free tiers, the Lambda free tier of 1 million requests and 400,000 GB-seconds per month applies indefinitely to both new and existing accounts, not just for the first 12 months.

How can I reduce AWS Lambda costs?

Tune memory to find the cheapest fast setting, switch functions to Graviton, cut log verbosity and retention, avoid unnecessary VPC and NAT Gateway use, and apply Compute Savings Plans where usage is steady.

FinOps OS powered by context-aware AI agents.

Start with a 30-day no-cost trial.

Read-only.

No credit card.

No commitment.

Want to assess how your FinOps journey can scale?

Benchmark maturity, close governance gaps, and drive ROI in under 20 minutes

Can your engineering context keep up with the speed of AI?

Start with a 14-day Runtime Accountability Audit. Read-only access. No commitment.

No credit card · No migration · No agents

STAY AHEAD

Can your engineering context keep up with the speed of AI?

Start with a 14-day Runtime Accountability Audit. Read-only access. No commitment.

No credit card · No migration · No agents

STAY AHEAD

Can your engineering context keep up with the speed of AI?

Start with a 14-day Runtime Accountability Audit. Read-only access. No commitment.

No credit card · No migration · No agents

STAY AHEAD