# GitHub Codespaces vs Buying a Laptop: 2026 Cost Math

> Laptop RAM costs soared in 2026. Here is the full GitHub Codespaces cost math by hours per month, the 30-hour breakeven, and when buying still wins.

Source: https://capitalandcompute.net/blog/github-codespaces-vs-laptop-cost/
Published: 2026-09-23
Updated: 2026-10-13

GitHub Codespaces is cheaper than buying a laptop only if you use it part-time. If it is your main machine for a full working month, buying still wins, even at 2026 hardware prices. The strongest case for Codespaces is narrower than “replace your laptop”: **buy the base-memory laptop and rent the big machine for the hours you actually need it.**

Here is the verdict by usage, using GitHub’s list prices as of September 23, 2026:

1. **Under about 22 hours a month of heavy work:** rent. A $4 GitHub Pro plan includes enough free compute to run a 32GB, 8-core codespace for 22.5 hours every month.
2. **About 30 hours a month on the big machine:** the breakeven. This is where renting 32GB of RAM costs the same over three years as paying a $400 memory upgrade up front.
3. **Full-time, 160 hours a month:** buy. An 8-core codespace used full-time costs about $3,700 over three years, nearly double a $1,999 MacBook Pro, and you still need a device to type on.

$0.09

Per core-hour, all sizes

GitHub docs, Sept 2026

22.5 h

Free 32GB time per month

GitHub Pro, 180 core-hours

\~30 h/mo

Breakeven vs a $400 RAM upgrade

3-year horizon

$3,708

8-core full-time, 3 years

vs $1,999 MacBook Pro

Key takeaways

* Codespaces compute costs a flat $0.09 per core-hour. The 2-core machine is $0.18 an hour and the 32GB, 8-core machine is $0.72 an hour, and those rates match what GitHub listed in early 2024.
* Hardware went the other way. Apple raised the MacBook Air from $1,099 to $1,299 and the MacBook Pro from $1,699 to $1,999 on June 25, 2026, citing memory costs.
* The free quota is counted in core-hours, not hours. The 120 included on a free account buys 60 hours on the smallest machine but only 15 hours on the 32GB one.
* Renting beats a $400 memory upgrade if you need the big machine for less than roughly 30 hours a month. Above that, the upgrade pays for itself within the life of the laptop.
* Full-time cloud development still costs more than owning, and Codespaces cannot run macOS, has no GPU machines, and deletes stopped codespaces after 30 days even with unpushed work.

## Why this question got interesting in 2026

For most of the last decade, “should I use a cloud dev environment to save money” had an easy answer: no. Laptops kept getting cheaper per unit of performance, and a rented machine billed by the hour could not compete with hardware you owned outright.

The memory shortage changed half of that equation. On June 25, 2026, Apple raised prices across its Mac and iPad lines. The [base MacBook Air went from $1,099 to $1,299 and the MacBook Pro M5 from $1,699 to $1,999](https://9to5mac.com/2026/06/25/apple-price-increases-mac-ipad-more/), according to 9to5Mac’s rundown of the new pricing, and Apple attributed the increases to memory and storage costs [as reported by Reuters](https://www.reuters.com/world/asia-pacific/apple-raises-prices-macbooks-ipads-memory-costs-skyrocket-2026-06-25/). Both prices were still in effect on [Apple’s US store](https://www.apple.com/shop/buy-mac/macbook-pro) when checked on September 23, 2026\. The full breakdown of that announcement is in [what Apple’s price hike means for local AI](/blog/apple-price-hike-local-ai/).

The upgrade tiers hurt more than the base prices. On the M5 MacBook Pro, [moving from 24GB to 48GB of unified memory costs $400](https://9to5mac.com/2026/03/03/apple-macbook-price-increase-ram-same/), per 9to5Mac’s March 2026 report on the configuration matrix. On the PC side, the cheapest mainstream 32GB DDR5 desktop kit was running $425 to $560 at US retail in mid-September, against roughly $80 in mid-2025, according to the site’s [memory price tracker](/memory-prices/). The underlying reason (AI data centers absorbing DRAM supply) is covered in [why RAM is so expensive in 2026](/blog/why-is-ram-so-expensive-ai-memory-shortage/). If you would rather build a desktop you can upgrade later, the same math for a DDR5 build is in [GitHub Codespaces vs building a PC](/blog/github-codespaces-vs-building-a-pc/).

Renting your own server did not escape either. Hetzner raised its x86 cloud plans in its US regions by 156% to 192% effective June 15, 2026, according to its own [price adjustment announcement](https://www.hetzner.com/pressroom/standardization-and-price-adjustment-of-our-server-products/), part of a wave of hikes logged on the [hosting price tracker](/hosting-price-hikes/).

Codespaces went the other way, or rather, nowhere. The rate table in GitHub’s current [Codespaces billing documentation](https://docs.github.com/en/billing/concepts/product-billing/github-codespaces) is identical to the one on the [archived January 2024 version of the same page](https://web.archive.org/web/20240101030719/https://docs.github.com/en/billing/managing-billing-for-github-codespaces/about-billing-for-github-codespaces): $0.18 an hour for 2 cores up to $2.88 for 32 cores, plus $0.07 per GB-month of storage. When the thing you own gets more expensive and the thing you rent does not, the breakeven moves. The question is how far.

## What Codespaces actually costs

Every machine size costs the same per core: $0.09 per core-hour. GitHub’s [Codespaces overview](https://docs.github.com/en/codespaces/about-codespaces/what-are-codespaces) documents the hardware range from 2 cores, 8GB RAM and 32GB storage up to 32 cores, 128GB RAM and 128GB storage, and the [GitHub pricing calculator](https://github.com/pricing/calculator?feature=codespaces) lists the RAM for each size.

| Machine | RAM   | Per hour | Free-account hours included | Pro hours included |
| ------- | ----- | -------- | --------------------------- | ------------------ |
| 2-core  | 8GB   | $0.18    | 60                          | 90                 |
| 4-core  | 16GB  | $0.36    | 30                          | 45                 |
| 8-core  | 32GB  | $0.72    | 15                          | 22.5               |
| 16-core | 64GB  | $1.44    | 7.5                         | 11.25              |
| 32-core | 128GB | $2.88    | 3.75                        | 5.63               |

Personal accounts get a monthly allowance: 120 core-hours and 15 GB-month of storage on GitHub Free, 180 core-hours and 20 GB-month on GitHub Pro, according to GitHub’s table of [product usage included with each plan](https://docs.github.com/en/billing/reference/product-usage-included). Pro costs $4 a month, and the plan comparison is in [GitHub pricing for 2026](/blog/github-pricing-plans-cost/). Students get Pro through the [GitHub Student Developer Pack](/blog/github-student-developer-pack-2026/), which means 180 free core-hours a month at no cost.

The free quota is core-hours, and GitHub's own docs disagree on the label

GitHub’s billing page labels the allowance “120 hrs”, while its plan-usage table and its [included-usage guide](https://docs.github.com/en/codespaces/troubleshooting/troubleshooting-included-usage) say core-hours, where active time is multiplied by the machine’s core count. The core-hour reading is the one billing applies. Several third-party pricing guides repeat “60 free hours” without saying that only holds on the 2-core machine. On the 32GB machine, a free account gets 15 hours.

Storage rarely matters. A typical codespace fits inside the included 15 to 20 GB-month, and overage is $0.07 per GB-month, so a codespace using 30GB all month on a free account adds about $1.05\. Compute is the whole bill.

## The math: full-time Codespaces vs owning a laptop

Take a full working month of 160 hours (8 hours a day, 20 days) on a Pro account, with the 180 free core-hours subtracted and the $4 plan fee added. Storage is assumed to stay within the allowance.

| Machine       | Monthly cost | 3-year cost |
| ------------- | ------------ | ----------- |
| 2-core, 8GB   | $16.60       | $598        |
| 4-core, 16GB  | $45.40       | $1,634      |
| 8-core, 32GB  | $103.00      | $3,708      |
| 16-core, 64GB | $218.20      | $7,855      |

Compare that with buying. The base M5 MacBook Air is $1,299 and the base M5 MacBook Pro is $1,999, both with 16GB of memory, at Apple’s US list prices on September 23, 2026.

A 16GB codespace used full-time costs $1,634 over three years. That is more than the Air and slightly less than the Pro, but it is not a replacement for either. You still need a device to connect from, a working internet connection all day, and you get no resale value at the end. The 32GB codespace, which is the machine people actually want when they are worried about RAM prices, costs $3,708 over three years, nearly double the Pro.

**Full-time, owning still wins.** It wins by less than it did in 2025, because the laptop price went up by $200 to $300 and the rental did not, but it still wins. The one full-time case where Codespaces is roughly even is a developer who already owns a laptop that is too slow to build on but fine as a thin client. Then the comparison is $1,634 over three years against $1,299 to $1,999 up front, paid monthly rather than all at once, on hardware that never ages.

## The hybrid: rent the RAM instead of buying it

The better question is not “laptop or Codespaces” but “which part of the laptop should you buy?” Most development does not need 32GB of memory all day. It needs it for a large build, a stack of containers, a big test suite or a data job, for a few hours at a time. The memory shortage makes that headroom the most expensive part of a new machine.

So compare the extra spend beyond a 16GB laptop: a $400 memory upgrade paid once, against renting a 32GB, 8-core codespace for the hours you need it, on a $4 Pro account.

__Buy the RAM or rent it: cumulative extra cost over 36 months. Cumulative cost by month for each approach.__
| Month | Buy +RAM upgrade | Rent 20 h/mo | Rent 40 h/mo |
| ----- | ---------------- | ------------ | ------------ |
| 0     | $400             | $0           | $0           |
| 6     | $400             | $24          | $100         |
| 12    | $400             | $48          | $199         |
| 18    | $400             | $72          | $299         |
| 24    | $400             | $96          | $398         |
| 30    | $400             | $120         | $498         |
| 36    | $400             | $144         | $598         |

Cumulative extra cost over three years: a $400 memory upgrade vs renting a 32GB, 8-core codespace for heavy work. Pro account at $4 a month with 180 free core-hours. At 20 hours a month the whole cost is the $4 plan fee. At 40 hours a month renting passes the upgrade in month 24.Source: [Capital & Compute model using GitHub Codespaces list prices, Sept 2026](https://docs.github.com/en/billing/concepts/product-billing/github-codespaces)

The breakeven over a three-year laptop life sits at about 30 hours a month on the 32GB machine, roughly an hour and a half per working day. Below that, renting is cheaper. Above it, the upgrade pays for itself before you would replace the laptop. At 80 hours a month, renting costs $45.40 a month and overtakes the $400 upgrade in under nine months.

How the breakeven is calculated

$400 spread over 36 months is $11.11 a month. Subtract the $4 Pro fee and $7.11 a month remains for paid compute, which buys 79 core-hours at $0.09\. Add the 180 free core-hours and the total is 259 core-hours, or 32.4 hours on an 8-core machine. On a free account (no fee, 120 free core-hours) the same calculation gives 30.4 hours. Both round to about 30 hours a month. The model ignores storage overage (about $1 a month at most for a typical project) and assumes the laptop runs for three years.

This is also why the $4 Pro plan earns its keep for this use. It adds 60 core-hours over the free tier, worth $5.40 at list price, so it pays for itself on Codespaces alone once you use the full allowance.

## Where Codespaces bills you by surprise

The list price is simple. The ways the bill grows are not, and every one of them comes from GitHub’s own documentation.

**Idle time is billed.** A codespace stops after 30 minutes of inactivity by default, and GitHub’s [timeout documentation](https://docs.github.com/en/codespaces/setting-your-user-preferences/setting-your-timeout-period-for-github-codespaces) states that you are billed for the whole time it stays running “irrespective of whether you were using it.” You can set the timeout anywhere from 5 minutes to 4 hours. On a 32GB machine, a forgotten codespace left at the 4-hour maximum burns 32 core-hours per incident, a fifth of the whole Pro allowance.

**Machine size multiplies everything.** Opening a repository whose configuration defaults to a large machine spends the quota four or eight times faster than the smallest machine. Check the machine type before you create the codespace, not after.

**Stopped codespaces still cost storage.** GitHub’s billing page measures storage as the disk a codespace occupies “while it exists,” running or not, and the [included-usage guide](https://docs.github.com/en/codespaces/troubleshooting/troubleshooting-included-usage) notes that deleting one does not reduce the usage already accrued that month. Prebuilds count toward storage too, and they are built with GitHub Actions minutes.

**Stopped codespaces are deleted, unpushed work included.** By default a codespace is deleted after 30 days stopped, and GitHub’s [retention documentation](https://docs.github.com/en/codespaces/setting-your-user-preferences/configuring-automatic-deletion-of-your-codespaces) says this happens “irrespective of whether a codespace contains unpushed changes.” That is a data-loss risk rather than a cost, but it is the one that surprises people most.

**Organizations get no free quota.** The allowances above apply to personal accounts only. GitHub states that its plans for organizations and enterprises “do not include a free quota” for Codespaces, so a company paying for its team’s codespaces pays from the first hour.

One default works in your favor. If you have no payment method on file, GitHub blocks usage once the quota runs out instead of billing you, so a free account cannot run up a surprise invoice.

## When Codespaces is the wrong answer

Some work cannot move to Codespaces at any price.

* **macOS and iOS development.** Every codespace runs in a Linux container. GitHub’s overview says “Windows and macOS are not supported operating systems for the remote development container,” so Xcode builds need a Mac.
* **Local AI and GPU work.** Codespaces offers only the five CPU machine sizes above. Running models locally still means buying memory, and [how much RAM you need to run a local LLM](/blog/how-much-ram-to-run-a-local-llm/) covers that decision.
* **Offline or unreliable connections.** Every keystroke of a remote session depends on the network. On a train or a weak connection, the cheapest machine is the one on your desk.
* **Heavy full-time use.** Past about 30 hours a month on the big machine, see the payback curve above.

__Buy a 32GB laptop, go all-Codespaces, or split the difference__
| Dimension           | Buy 32GB laptop   | All Codespaces     | 16GB laptop + rent |
| ------------------- | ----------------- | ------------------ | ------------------ |
| Upfront cost        | Highest           | None               | Base price only    |
| Full-time cost      | Lowest            | $3,708 for 32GB    | Laptop plus usage  |
| Under 30 heavy h/mo | Pays for idle RAM | Needs a client     | Cheapest           |
| Works offline       | Yes               | No                 | Light work, yes    |
| macOS, local AI     | Supported         | Linux, CPU only    | Local, limited RAM |
| Price risk          | Paid at 2026 peak | Rates could change | Spread across both |

Buy, rent or split: how the three approaches compare for a developer choosing a machine in 2026.Source: Capital & Compute analysis of GitHub Codespaces documentation and Apple US list prices, Sept 2026

## How to set up the hybrid

If the hybrid fits, a few settings keep it inside the free allowance:

1. **Use the 2-core machine for everyday work** and pick the 8-core only for the heavy task. A day of light editing on 2 cores costs a quarter of the same day on 8.
2. **Cut the idle timeout** to 10 or 15 minutes in your Codespaces settings, well below the 30-minute default.
3. **Set a short retention period** and push work before stopping, so abandoned codespaces stop accruing storage and nothing is lost when they are deleted.
4. **Turn on the included-usage alerts** at 90% and 100%, which GitHub’s billing page says you can receive by email.
5. **Commit to a dev container configuration** in the repository. A `devcontainer.json` makes the codespace reproducible, which is the part of Codespaces that saves time as well as money.

The risk to watch is on the rental side. GitHub has kept these rates flat through the shortage so far, but nothing in its documentation promises it will keep doing so, while the cloud hosts in the same market have raised prices. If the rate table changes, the 30-hour breakeven moves with it, and this page will be updated.

## Full comparison with the free core-hours included

Every figure below subtracts the monthly free allowance before charging anything: 120 core-hours on a free account, 180 on Pro, with Pro’s $4 fee added. The “best plan” column is whichever account is cheaper at that usage. Storage is assumed to stay inside the included 15 to 20 GB-month.

The two plans cross at about 165 core-hours a month. Below that, a free account is cheaper, because Pro’s extra 60 core-hours are not fully used. Above it, Pro saves $1.40 a month. Those 60 core-hours are worth $5.40, against a $4 fee.

**Replacing the laptop:** a 16GB, 4-core codespace against a 16GB MacBook Air at $1,299.

| Hours per month | Core-hours used | Free account | Pro account | Best plan, 3 years | Buy instead | Cheaper over 3 years      |
| --------------- | --------------- | ------------ | ----------- | ------------------ | ----------- | ------------------------- |
| 20              | 80              | $0.00        | $4.00       | $0 (Free)          | $1,299 Air  | Codespaces                |
| 40              | 160             | $3.60        | $4.00       | $130 (Free)        | $1,299 Air  | Codespaces                |
| 80              | 320             | $18.00       | $16.60      | $598 (Pro)         | $1,299 Air  | Codespaces, with a client |
| 160 (full-time) | 640             | $46.80       | $45.40      | $1,634 (Pro)       | $1,299 Air  | Buy the laptop            |

**Renting the extra RAM:** a 32GB, 8-core codespace for heavy work only, against a $400 memory upgrade on a laptop you are buying anyway.

| Hours per month | Core-hours used | Free account | Pro account | Best plan, 3 years | Buy instead        | Cheaper over 3 years |
| --------------- | --------------- | ------------ | ----------- | ------------------ | ------------------ | -------------------- |
| 20              | 160             | $3.60        | $4.00       | $130 (Free)        | $400 upgrade       | Rent                 |
| 40              | 320             | $18.00       | $16.60      | $598 (Pro)         | $400 upgrade       | Buy the upgrade      |
| 80              | 640             | $46.80       | $45.40      | $1,634 (Pro)       | $400 upgrade       | Buy the upgrade      |
| 160 (full-time) | 1,280           | $104.40      | $103.00     | $3,708 (Pro)       | $1,999 MacBook Pro | Buy the laptop       |

Read the first table carefully. Up to about 134 hours a month, a 16GB codespace costs less over three years than a $1,299 MacBook Air. But the codespace does not include a screen or keyboard. It only wins if you already own a laptop, tablet or Chromebook that works well enough to connect from. If you would have to buy that device anyway, the laptop wins at almost any regular usage.

The second table is where the free core-hours matter most. At 20 heavy hours a month, the allowance covers nearly all of the 32GB machine, and three years cost $130 against a $400 upgrade. Double the usage to 40 hours and the free hours no longer stretch far enough, so the upgrade wins.

## Frequently asked questions

## Frequently asked questions

Is GitHub Codespaces cheaper than buying a laptop?

Only for part-time use. A 32GB, 8-core codespace used full-time costs about $3,708 over three years at GitHub list prices, nearly double a $1,999 MacBook Pro. For under about 30 hours a month of heavy work, renting that machine is cheaper than paying for a $400 memory upgrade.

How much does GitHub Codespaces cost per month?

Compute costs $0.09 per core-hour, so $0.18 an hour for the 2-core machine and $0.72 an hour for the 8-core, 32GB machine, plus $0.07 per GB-month of storage. Personal accounts get 120 free core-hours a month on GitHub Free and 180 on GitHub Pro, which cost $4 a month. Full-time use of a 16GB, 4-core machine on Pro works out to about $45 a month.

How many free hours does GitHub Codespaces include?

The free allowance is counted in core-hours: 120 a month on a free account and 180 on Pro. That is 60 hours on the 2-core machine but only 15 hours on the 8-core, 32GB machine for a free account, or 22.5 hours on Pro. Organization accounts get no free quota.

Are GitHub Codespaces prices going up because of the memory shortage?

Not so far. The per-hour rates in the Codespaces billing documentation checked in September 2026 match the archived January 2024 version: $0.18 to $2.88 per hour by machine size and $0.07 per GB-month of storage. Other cloud hosts, including Hetzner, raised prices in 2026, so the rates are worth rechecking before a long-term decision.

Can I use GitHub Codespaces for iOS development or running local AI models?

No for iOS and macOS work, since every codespace runs in a Linux container and GitHub does not support macOS. For local AI, Codespaces offers only CPU machines up to 32 cores and 128GB of RAM, with no GPU options, so running models on a GPU still means buying hardware.

## Sources

* GitHub (2026). _GitHub Codespaces billing_. GitHub Docs. <https://docs.github.com/en/billing/concepts/product-billing/github-codespaces>
* GitHub (2024). _About billing for GitHub Codespaces_, archived January 1, 2024\. GitHub Docs via the Internet Archive. <https://web.archive.org/web/20240101030719/https://docs.github.com/en/billing/managing-billing-for-github-codespaces/about-billing-for-github-codespaces>
* GitHub (2026). _Product usage included with each plan_. GitHub Docs. <https://docs.github.com/en/billing/reference/product-usage-included>
* GitHub (2026). _Getting the most out of your included usage_. GitHub Docs. <https://docs.github.com/en/codespaces/troubleshooting/troubleshooting-included-usage>
* GitHub (2026). _What are GitHub Codespaces?_ GitHub Docs. <https://docs.github.com/en/codespaces/about-codespaces/what-are-codespaces>
* GitHub (2026). _Setting your timeout period for GitHub Codespaces_. GitHub Docs. <https://docs.github.com/en/codespaces/setting-your-user-preferences/setting-your-timeout-period-for-github-codespaces>
* GitHub (2026). _Configuring automatic deletion of your codespaces_. GitHub Docs. <https://docs.github.com/en/codespaces/setting-your-user-preferences/configuring-automatic-deletion-of-your-codespaces>
* GitHub (2026). _Pricing calculator_. GitHub. <https://github.com/pricing/calculator?feature=codespaces>
* GitHub (2022). _Codespaces for Free and Pro Accounts_. GitHub Changelog. <https://github.blog/changelog/2022-11-09-codespaces-for-free-and-pro-accounts/>
* Apple (2026). _Buy MacBook Pro_ and _Buy MacBook Air_. Apple Store (US), checked September 23, 2026\. <https://www.apple.com/shop/buy-mac/macbook-pro>
* 9to5Mac (2026). _Apple announces significant price increases for MacBooks, iPads, more_. 9to5Mac (secondary). <https://9to5mac.com/2026/06/25/apple-price-increases-mac-ipad-more/>
* 9to5Mac (2026). _Apple raises base price of MacBook Air and MacBook Pro, but RAM upgrade costs remain unchanged_. 9to5Mac (secondary). <https://9to5mac.com/2026/03/03/apple-macbook-price-increase-ram-same/>
* Reuters (2026). _Apple raises prices on MacBooks, iPads as memory costs skyrocket_. Reuters (secondary). <https://www.reuters.com/world/asia-pacific/apple-raises-prices-macbooks-ipads-memory-costs-skyrocket-2026-06-25/>
* Hetzner Online (2026). _Details regarding the standardization and price adjustment of our server products effective 15 June 2026_. Hetzner press room. <https://www.hetzner.com/pressroom/standardization-and-price-adjustment-of-our-server-products/>
