Home/Library/Fargate vs EC2 for Containers
Comparison · AWS · Updated May 2026

Fargate vs EC2 for Containers: A Cost Comparison

Fargate charges per task and removes the servers; EC2 charges per instance and makes you pack them. Neither is cheaper in the abstract. The answer depends on how steady your workload is and how full you can keep a node.

The Fargate vs EC2 cost comparison for containers comes down to a single trade: Fargate prices each task by the vCPU and memory it requests and removes all node management, while EC2 prices the instances you run and leaves you to pack containers onto them efficiently. Fargate tends to win for spiky, bursty or low-utilization workloads where you would otherwise pay for half-empty nodes, and EC2 tends to win for steady, high-utilization workloads where you can keep instances densely packed and layer on Spot and commitment discounts. The deciding variables are utilization, how predictable the load is, and how much operational effort you want to spend on bin packing.

This comparison sits under our complete guide to AWS cost optimization, the pillar for this cluster, and supports the Cut step of our See, Cut, Lock, Run method by choosing the right compute model before optimizing rates. It pairs with the deeper EKS view in Amazon EKS cost optimization, a sibling in this cluster.

The pricing models differ in kind

Fargate bills the resources each task requests, so you pay for what you ask for whether the task uses it or not. EC2 bills the instance, so unused capacity on a node is yours to fill, and to waste. The comparison is really about who carries the packing problem.

When Fargate is cheaper

Fargate wins where node utilization on EC2 would be low. Bursty workloads that scale to zero or near it, scheduled batch jobs, and small services that cannot fill an instance all favor Fargate, because you pay only for the task duration and size rather than for a node that sits mostly idle between bursts. It also removes the operational cost of managing, patching and right-sizing nodes, which is a real saving even though it does not show on the compute line. For teams running many small or intermittent services, the per-task model often beats a fleet of under-packed instances once node overhead and management time are counted.

When EC2 is cheaper

EC2 wins where you can keep nodes densely packed and the load is steady enough to commit to. A high-utilization workload bin-packed onto right-sized instances pays for the resources it uses with little waste, and on top of that base you can apply EC2 Spot for fault-tolerant tasks and Savings Plans for the steady floor, discounts that reach much deeper than Fargate's own commitment options. The catch is that this efficiency is not free: it requires real bin-packing effort, autoscaling that keeps nodes full, and ongoing right-sizing. For a workload large and steady enough to justify that effort, EC2 with Spot and Savings Plans is usually the lowest-cost option. See Spot instances and when the discount is worth the risk for that lever.

Not sure which model your workloads belong on?

Our AWS cost audit profiles each containerized workload by utilization and burstiness, models Fargate against EC2 with Spot and Savings Plans, and recommends the cheaper model per service. On the performance model you pay only from realized savings. No savings, no fee.

Book an AWS cost audit →

It is not all-or-nothing

The most cost-effective answer is usually a split rather than a single choice. Run the steady, high-utilization core of your platform on EC2 with Spot and Savings Plans where the packing effort pays off, and run the bursty, intermittent or small services on Fargate where node utilization would otherwise be poor. Both ECS and EKS support mixing Fargate and EC2 capacity in the same cluster, so the decision is per workload, not per platform. Revisit it as workloads change shape, because a service that was bursty at launch may become steady at scale and earn a move to EC2, and vice versa.

FactorFavors FargateFavors EC2
UtilizationLow or spikyHigh and steady
Packing effortNone wantedWilling to bin-pack
Discount depthLimitedSpot plus Savings Plans
Ops overheadRemovedNode management owned

AWS Fargate per-task pricing, EC2 instance pricing, Spot availability and Savings Plan coverage of Fargate and EC2 reflect AWS as of May 2026. Verify current per-vCPU and per-GB Fargate rates and EC2 instance prices on the AWS pricing pages before modeling, as these change and vary by region.

Go deeper · free field guide

The AWS Cost Optimization Field Guide includes the per-workload model we use to compare Fargate against EC2 with Spot and Savings Plans, including the utilization threshold where the answer flips.

The short version

Fargate versus EC2 for containers is decided by utilization and packing, not by a headline rate. Fargate's per-task pricing wins for bursty, low-utilization and small services where EC2 nodes would sit half empty; EC2 with bin packing, Spot and Savings Plans wins for steady, high-utilization workloads where the packing effort pays off. The best answer is usually a per-workload split across both. Choosing the right compute model per service is a routine part of an AWS cost optimization engagement, as in our SaaS on AWS case study.

The Cloud Cost Brief

Cloud pricing moves. We tell you when it matters.

New commitment instruments, FOCUS changes, hyperscaler pricing shifts, and the plays that actually move a bill. No schedule, no filler.

Subscribe · Work email only