Skip to content

E2B vs Modal Sandboxes

On this page

The short version

E2B and Modal Sandboxes both let your code start isolated Linux sandboxes and pay for them by the second, and both stop a single run at 24 hours. Pick E2B when sandboxes follow a user's session: a pause keeps memory and processes with no expiry, a request can wake it, a fork copies it mid-run, and its Code Interpreter SDK returns charts as data. Pick Modal when runs need GPUs, raw TCP, a region near your users or a credit that renews: Starter includes $30 of compute every month, and Modal reports a median start under 500 ms at scale.

E2B vs Modal Sandboxes features

Running time and stateE2BModal Sandboxes
Longest uninterrupted run1 hour on Hobby, 24 hours on Pro. Resuming starts the clock again5 minutes by default, 24 hours at most
When a run endsDeleted, unless auto-pause keeps it, with no expiryEnds. A snapshot can start a new Sandbox with its files
Freeze it with memory and processesYesPause, resumed in about 1 secondAlpha memory snapshots: they end the original, restore within 7 days and skip GPU Sandboxes
Wakes when a request arrivesYesOpt-in auto-resumeNoYour code starts a new Sandbox
Branch a running sandboxYesFork with memory, up to 20 copies a callYesSnapshot its filesystem and start copies
How long saved state is keptPaused sandboxes have no expiryFilesystem snapshots 30 days by default, or forever. Memory snapshots 7 days
Cost and limitsE2BModal Sandboxes
Rates while running$0.0504 a vCPU-hour and $0.0162 a GiB-hourAbout $0.142 a core-hour (2 vCPUs) and $0.024 a GiB-hour, at the higher of request and use
Free usage$100 onceYes$30 every month on Starter
Sizes on the free planThe default 2 vCPUs and 512 MiB onlyYesThe CPU and memory you request
Paid planPro, $150 a month: custom sizes, 24-hour runsTeam, $250 a month with $100 of compute: any number of seats, 5,000 containers
Sandboxes at once10 on Hobby, 100 on Pro, up to 1,100 with add-ons100 on Starter, 5,000 on Team
Where it runs5 regions. US West by default, the rest on request19 locations to choose from, at 1.15 to 1.75 times the rate
Building on itE2BModal Sandboxes
What each sandbox isA Firecracker microVM with its own kernelA gVisor container, or a Linux VM that runs Docker and systemd
GPUsNoCPU onlyYesT4 to B300, by the second. GPU Sandboxes can be preempted
Code interpreter that keeps variablesYesReturns charts and tables as dataBuild your own over the Sandbox's input and output
Computer-use agentsYesDesktop template with screenshot and input APIsA VNC recipe for a VM Sandbox
Public TCP portsNoHTTP and WebSocket onlyYesRaw TCP tunnels
Custom domainsYesEvery planTeam and Enterprise
API keys kept out of the sandboxYesSecrets added to outbound requestsBeta: an outbound policy adds headers to HTTPS calls
Fixed outbound addressThrough a proxy you runTeam and Enterprise, through a static egress proxy

Both run your own images, keep previews private behind tokens, limit outbound traffic by CIDR or domain, and have SOC 2 and a HIPAA option.

Who should pick E2B

E2B fits an agent product where each user has a sandbox that comes and goes with their session.

  • Sessions that resume. A full pause keeps files, memory and processes with no expiry, compute billing stops while it's paused, and auto-resume wakes it when a request arrives. A user can leave mid-task and return the next day.
  • Branching from a running state. One fork call copies a running sandbox, memory included, into up to 20 new ones.
  • Ready-made parts. The Code Interpreter SDK keeps variables and returns charts, the Desktop template gives computer-use agents screenshot and input APIs, and ACP starts a coding agent and streams its session to your app.
  • Your own infrastructure. E2B Embed is open source under Apache-2.0, and Enterprise can run in your AWS, Google Cloud or Azure account.

It isn't the fit for GPU work, or for runs over an hour or above 512 MiB without Pro at $150 a month.

Who should pick Modal Sandboxes

Modal fits code that fans out many runs from Python and needs more than a CPU box to do it.

  • GPUs by the second. A Sandbox can attach anything from a T4 to a B300 and pay per second. GPU Sandboxes can be preempted, so their work should survive a retry.
  • A credit that renews. Starter includes $30 of compute every month, any size you request, and 100 containers at once, with no monthly fee.
  • Scale and regions. Modal measured a median under 500 ms from create to running code while launching a million Sandboxes. You can pin Sandboxes to 19 locations, and a Sandbox can burst past its request when capacity is free.
  • A VM when you need one, and raw TCP. The VM runtime runs Docker and systemd, and tunnels can expose raw TCP as well as HTTPS.

It isn't the fit when a user's sandbox has to come back with its memory, since memory snapshots are in alpha, end the original and expire after 7 days.

Pricing

PlanPriceWhat you get
E2B Hobby$0 plus usage, $100 of credit onceThe default 2 vCPU, 512 MiB sandbox, 10 at once, runs up to 1 hour
E2B Pro$150 a month plus usageSizes up to 8 vCPUs and 8 GiB, 100 at once, runs up to 24 hours
Modal Starter$0 plus usage$30 of compute a month, 3 seats, 100 containers at once, 1 TiB of egress
Modal Team$250 a month plus usage$100 of compute a month, any number of seats, 5,000 containers, 10 TiB of egress

A Modal core is 2 vCPUs, and Modal bills at least what a Sandbox requests. At E2B's default size, 2 vCPUs and 512 MiB, an hour costs $0.1089 on E2B and $0.1539 on Modal.

300 short runs. 300 runs a month of 20 minutes at that size are 100 hours: $10.89 on E2B Hobby, covered by the one-time credit for about nine months, and $0 on Modal, inside the monthly credit.

A coding agent's long runs. 60 runs a month of 2 hours at 2 vCPUs and 4 GiB are 120 hours. E2B needs Pro for the size and the length: $169.87. Modal comes to $28.56, so $0 after Starter's credit.

A busy month. At 1,000 hours of the default size, E2B Hobby costs $108.90 and Modal $123.92 after its credit. Modal costs less until about 666 hours a month at this size, and E2B costs less above it, as long as 512 MiB is enough.

Frequently asked questions

Which is cheaper for a month of agent runs?

Modal, below about 666 run-hours a month at 2 vCPUs and 512 MiB, because of its $30 monthly credit. Above that, E2B Hobby costs less if 512 MiB is enough. Runs that need more memory or more than an hour put E2B on Pro at $150 a month.

Can a user come back to the same sandbox the next day?

On E2B, yes. A full pause keeps files, memory and processes, with no expiry. Modal ends a Sandbox when it times out, and a filesystem or alpha memory snapshot starts a new one. Memory snapshots expire after 7 days.

Can either run a job for more than 24 hours?

Not in one run. Both stop a run at 24 hours, and E2B Hobby at 1 hour. E2B starts the clock again when a paused sandbox resumes.

Also consider Heaven

Heaven, which we make, is cloud infrastructure for software factories. Each agent or app gets a Computer: a full Linux VM with root that keeps running with nobody connected, and a team's Computers share one pool of CPU, memory and storage. Every Computer comes with an HTTPS website with sign-in in front, share links, custom domains, public TCP ports, email, snapshots and hourly off-site backups, and integrations keep GitHub and API credentials outside the machine. Plans start at $20 a month for 2 vCPUs and 8 GiB, with any number of members. See pricing.

See E2B alternatives, Modal Sandboxes alternatives, E2B vs Daytona, Daytona vs Modal Sandboxes and the best code sandboxes for AI agents.

Run your agents on Heaven

Persistent Linux Computers that share CPU, memory and storage in one pool. Tiny is $20 a month.

Sources and corrections

SourceChecked
1E2B pricingNovember 20, 2026
2E2B plans and limitsNovember 19, 2026
3E2B auto-pause and persistenceNovember 19, 2026
4E2B auto-resumeNovember 19, 2026
5E2B forkNovember 20, 2026
6E2B GPU supportNovember 19, 2026
7E2B SDKsNovember 19, 2026
8E2B interpreter contextsNovember 19, 2026
9E2B computer useNovember 19, 2026
10E2B ACPNovember 19, 2026
11E2B ingress accessNovember 19, 2026
12E2B custom domainsNovember 19, 2026
13E2B secrets injectionNovember 19, 2026
14E2B regionsNovember 19, 2026
15E2B BYOCNovember 19, 2026
16E2B EmbedNovember 19, 2026
17Modal pricingNovember 19, 2026
18Modal Sandbox timeoutsNovember 19, 2026
19Modal runtimesNovember 19, 2026
20Modal Sandbox resources and billingNovember 19, 2026
21Modal GPU SandboxesNovember 19, 2026
22Modal snapshotsNovember 19, 2026
23Modal memory snapshot limitsNovember 19, 2026
24Modal Sandbox networkingNovember 19, 2026
25Modal static egressNovember 19, 2026
26Modal secret injectionNovember 19, 2026
27Modal interpreter exampleNovember 19, 2026
28Modal computer-use exampleNovember 19, 2026
29Modal JavaScript and Go SDKsNovember 19, 2026
30Modal regionsNovember 19, 2026
31Modal scale testNovember 19, 2026

Spot an error? Email support@heaven.dev with the page, the claim and a source.