Skip to content

For developers

13 Idle Game Cost Formulas From Real Games, With the Actual Numbers

Idle game cost formula examples from Cookie Clicker, Antimatter Dimensions, Kittens Game and more: real growth rates, bulk-buy math and when to use each.

Most idle games price the next purchase with one line: cost = base × rate^owned. Cookie Clicker uses a rate of 1.15, AdVenture Capitalist's Lemonade Stand 1.07, a Kittens Game hut 2.5. The decisions that make a game feel different sit around that line: which rate for which tier, when the rate itself should grow, what discounts touch, and how bulk buying and prestige fit on top.

Each entry below is one formula you can copy, shown in a real game, with the numbers checked against the game's wiki, its public source code or the developer's own write-up. Where a value comes from source code, the link goes to the file, so you can read the implementation instead of trusting a summary.

02

AdVenture Capitalist: best for tiered generators with different growth rates

Platform: Steam, Mobile · free-to-play

Anthony Pecorella's The Math of Idle Games, Part I, first published on Kongregate's developer blog, uses AdVenture Capitalist as its worked example: the Lemonade Stand has a base cost of about 3.738 and a growth rate of 1.07. The AdVenture Capitalist wiki lists the next tiers at $60 with a 1.15 coefficient (Newspaper Delivery) and $720 with 1.14 (Car Wash).

The lesson is the low first rate. At 1.07 the cheapest business only doubles in price about every ten purchases (1.07^10 is about 1.97), so players keep buying it long enough to reach the ownership milestones the game rewards, while pricier tiers climb faster.

Use per-tier rates when you want the first generator to stay relevant for hours and later ones to feel like real investments.

Watch out for: The wiki values are community-measured. Treat them as a starting point and test your own curve; Pecorella notes his closed-form math assumes one fixed rate per generator.

03

Bulk-buy and Buy Max in closed form: best for x10, x100 and Max buttons without loops

Platform: Any engine. Formulas from The Math of Idle Games, Part I (Game Developer)

Once costs follow base × rate^owned, the price of buying n at once is a geometric series: cost = b × r^k × (r^n - 1) / (r - 1), where b is the base price, r the rate and k the number already owned. The largest n you can afford with c currency is floor(log_r(c × (r - 1) / (b × r^k) + 1)). Both are straight from Pecorella's article.

Use them for a Buy Max button, a 'next 10 cost' tooltip and automation that buys in batches. A loop that subtracts one price at a time gets slow, and drifts with floating-point error, once players own thousands of something.

The same formulas work with a big-number library's log and pow functions. Our big number library guide covers which one to pick.

Watch out for: The closed form breaks the moment your rate changes partway, as with a cost wall or Antimatter Dimensions' post-Infinity scaling. Split the purchase at the threshold, or loop over that segment only.

04

Clicker Heroes: best for leveling a few heroes instead of buying copies

Platform: Steam, Browser, Mobile · free-to-play

Clicker Heroes prices hero levels rather than copies. Per the Clicker Heroes wiki, the next level costs floor(floor(base × 1.07^level) × reduction), where the reduction comes from the Dogcog ancient. The wiki's worked example: Treebeast, base cost 50, costs 111,871 gold to go from level 114 to 115.

Later content uses a steeper rate. The four Ace Scouts heroes added in a later patch use 1.22, which the wiki notes more than doubles their cost every five levels. Raising the rate for new heroes keeps them from flattening the old curve.

Use this shape for heroes, weapons or skills where the player invests in a handful of named things.

Watch out for: Dogcog's discount climbs toward 99.99999999% off. Floor every step as Clicker Heroes does, and decide in advance what happens when a discount gets that close to free.

05

Antimatter Dimensions: best for prices that jump once every 10 purchases

Platform: Browser, Steam, Mobile · free

In Antimatter Dimensions the price of a Dimension only changes every 10 copies. The game's source code sets base costs of 10, 100, 1e4, 1e6, 1e9, 1e13, 1e18 and 1e24 for the eight Dimensions, and multiplies the price by 1e3, 1e4, 1e5, 1e6, 1e8, 1e10, 1e12 and 1e15 per set of 10. Each completed set doubles that Dimension's output. Tickspeed starts at 1,000 and multiplies by 10 per purchase.

Stepped prices turn buying into a small plan: finish the set, collect the multiplier, accept that the next set costs a thousand times more. Higher tiers jump harder, so the cheap Dimensions stay the place to spend spare antimatter.

Use it when you want players thinking in groups and milestones rather than single clicks.

Watch out for: Jumps this large need a number display plan from day one. The first prestige, Infinity, happens at about 1.8e308, the largest standard JavaScript number, so notation and a big-number type are not optional.

06

Rising-ratio scaling past a threshold: best for late-game walls that still feel fair

Platform: Any engine. Implemented in Antimatter Dimensions' ExponentialCostScaling class (math.js)

Antimatter Dimensions' ExponentialCostScaling class takes a third number. Prices run B, B×C, B×C² as normal until they pass a threshold; after that, the ratio between consecutive prices itself grows by a factor S on every step. For Dimensions and Tickspeed the threshold is Number.MAX_VALUE (about 1.8e308) and S starts at 10.

This is the polite version of a cost wall: no sudden 100x cliff, just a curve that bends harder and harder. The game's cache code subtracts Break Infinity upgrades and an Eternity Challenge reward from that 10, so the wall becomes something players earn their way through rather than a hard stop.

Use it when a prestige layer should eventually feel necessary without capping anyone outright.

Watch out for: Buy Max gets harder past the threshold because the closed form no longer applies. Antimatter Dimensions has a dedicated getMaxBought method for it; budget time to write and test yours.

07

Kittens Game: best for upgrades that bend the curve, not the price

Platform: Browser, Mobile · free

Every building in Kittens Game has a priceRatio in buildings.js. The Catnip Field starts at 10 catnip with a ratio of 1.12, the Hut at 5 wood with a ratio of 2.5, and most buildings use 1.15, with a few at 1.10, 1.25, 1.5 or 1.75.

The clever part is getPriceRatioWithAccessor. Upgrades do not discount prices; they subtract from the ratio, and the total reduction passes through a diminishing-returns function limited by how far the ratio sits above 1. A 1.15 building can approach 1.0 but never reach it, so stacked reductions never make buildings free.

Ratio cuts get stronger the more you own. Taking a 1.15 building to 1.10 makes the 50th copy roughly nine times cheaper, which no flat 10% coupon could do.

Watch out for: Because ratio cuts compound with ownership, they are far stronger late than a tooltip suggests. Show the new ratio, not a vague percentage, or players cannot judge them.

08

Trimps: best for storage buildings priced as a share of the cap

Platform: Browser · free

Trimps mixes two models. The Hut is a classic exponential: 125 food and 75 wood, each multiplied by 1.24 per purchase, in the game's config.js. The Barn is different: its food cost is 25% of your current maximum food, worked out by calculatePercentageBuildingCost in main.js, and each Barn doubles that maximum.

Pricing storage as a share of the cap means it is always affordable at the same fill level, however far the economy has grown. Players learn a rule of thumb, buy a Barn when the bar passes a quarter, instead of doing arithmetic.

Use percentage pricing for anything whose value is relative: storage, capacity, batch size.

Watch out for: If income refills the cap in seconds, a percentage cost stops being a decision and turns into a click tax. Keep production per second well below the cap for it to matter.

09

The Prestige Tree: best for prestige layers that cost more on each reset

Platform: Browser · free

The Prestige Tree runs on The Modding Tree framework, which has two built-in prestige types documented in layer-features.md. A 'normal' layer pays out based on baseResource^exponent over the requirement. A 'static' layer prices each point at about requires × base^(owned^exponent), so you shape how fast the next point gets expensive with two numbers.

Normal layers also ship with a softcap: gain beyond e1e7 is raised to the 0.5 power by default. That is a cost formula in disguise, because a square-rooted reward means each extra order of magnitude of gain needs two orders of magnitude more input.

Use static layers for 'buy one at a time' prestige currencies and normal layers for 'reset for a pile' ones. Our Modding Tree tutorial walks through both.

Watch out for: Static layers need canBuyMax set, or players can only take one point per reset, which feels like a bug once the numbers get large.

10

Melvor Idle: best for skill levels with a famous halfway point

Platform: Browser, Steam, Mobile · paid

Skill idlers price levels in experience, not currency. Melvor Idle's experience table lists 13,034,431 XP for level 99, the same total the Old School RuneScape wiki gives for RuneScape's curve: XP(L) = floor(¼ × sum of floor(l + 300 × 2^(l/7)) for l from 1 to L - 1).

The 2^(l/7) term doubles the per-level requirement about every seven levels, which is why level 92 sits near the halfway mark to 99. A landmark like that gives players something to talk about and aim for.

Copy it if your audience already knows the curve. Melvor's Throne of the Herald expansion raises the cap to 120 on the same table, so the curve extends cleanly.

Watch out for: A level curve is a time cost. Work out what level 99 means in hours at your XP rates before you copy RuneScape's numbers; it suits Melvor's skilling audience and few others.

11 · Ours

Mushies!: best for a Godot case study with mixed ratios

Platform: Browser, Steam

Mushies! is the cozy pixel-art mushroom-village clicker made by this site's maintainer, built in Godot, with a free browser demo. Its code uses the constant-ratio model: each worker shroom costs base × 1.2^owned (the starting Shaker costs 20 spores), the Builder shroom scales at 2.0, and houses scale at 1.5 in both spores and caps.

Two choices in the code are worth borrowing. The Spore Garden multiplies its normal price by 2.5^gardens, so the first garden is cheap and the fifth is a commitment. And an earlier build had cost walls, fixed multipliers at certain counts, which were removed; the comment left in the code says the reachable ones 'did nothing an exponential wasn't already doing.'

In GDScript the whole thing is one line, base_cost * pow(scaling, count), with each ratio stored in the shroom's resource file so it can be tuned without touching code.

Watch out for: Mushies is still in development and these values come from its current build, so they may change before the Steam release. Plain floats are fine at its scale; a game headed past 1e308 needs a big-number type.

12

Realm Grinder: best for pricing the prestige reset itself

Platform: Steam, Browser, Mobile · free-to-play

Prestige currency is a cost curve pointed at the reset. In The Math of Idle Games, Part III, Pecorella gives Realm Grinder's gems as p = (sqrt(1 + 8 × c / 1e12) - 1) / 2 on maximum coins, Cookie Clicker's prestige as the cube root of lifetime cookies over 1e12, and Egg, Inc.'s per-run gain as (c / 1e6)^0.14.

The shape sets the price of each extra point. Realm Grinder's triangular formula is the gentlest: the nth gem asks for roughly n trillion more coins. Under a cube root, doubling prestige needs eight times the earnings; under Egg, Inc.'s 0.14 power it needs about 140 times.

Pick the shape by how often you want players to reset, then test reset timing against it. Our prestige system examples compare how these feel in play.

Watch out for: These formulas come from a 2016 article and live games rebalance. Check each game's current wiki before quoting them as today's values.

13

Tune by order of magnitude (Idle Idol): best for small teams tuning 40+ upgrades

Platform: Spreadsheet method. Gabriel Padinha's Idle Idol balancing write-up on Game Developer (2020)

Gabriel Padinha's balancing write-up describes the classic trap. Idle Idol's upgrades used about 1.1x growth on both cost and reward, and 'even a 0.01 difference would mean a huge difference' by the 20th upgrade. Costs overtook rewards around level 35, and each playtest took days.

The fix was to stop tuning raw prices. The team rebuilt costs around orders of magnitude (10, 1,000, a million, a trillion) and moved every upgrade into a spreadsheet driven by a few parameters, so one change re-priced all 40+ upgrades at once.

Do this before writing code. A sheet with columns for level, cost, production and time-to-afford finds a broken rate faster than any playtest.

Watch out for: A spreadsheet only models the player you imagine. Log real purchase times from testers and compare them with the sheet's time-to-afford column.

How to choose a cost formula

Pick the rate, then the shape, then the number type. In that order.

01

Match the rate to the session

Translate every rate into a doubling period: purchases until the price doubles, which is ln 2 / ln r. A rate of 1.07 doubles about every 10 purchases (AdVenture Capitalist's Lemonade Stand), 1.15 every 5 (Cookie Clicker), 1.24 every 3 (Trimps huts), and 2.5 on every single purchase (Kittens Game huts). Short-session clickers want fast doubling so new tiers arrive often; long idle games want slow doubling so a few minutes of play still buys something.

02

Match the shape to the decision

If players buy copies, use one ratio like Cookie Clicker. If they level a few named things, use per-level pricing like Clicker Heroes. If you want milestones, price in sets of 10 like Antimatter Dimensions. For storage, try Trimps' share-of-cap pricing. For upgrades that should matter more over time, cut the ratio itself, as Kittens Game does. Mixing two or three shapes in one game is normal.

03

Match the math to your number type

Standard doubles stop at about 1.8e308. If your curve gets anywhere near that, pick a library such as break_infinity.js before writing the economy, and use the closed-form bulk-buy formulas so Buy Max stays fast. If you stay under a few billion, plain floats and a loop are fine; Mushies! uses Godot's built-in pow() and floats.

Put your curve in a spreadsheet tonight

Open a sheet, list your generators with a base price and a rate, add a column for price at 10, 25 and 100 owned, and a column for minutes to afford at your expected income. Ten minutes of that will tell you whether 1.15 or 1.07 is right for your game, and it is the same method the Idle Idol team ended up with.

When the game is playable, list it on IncrementalGames.org for free so players who care about this kind of balance can find it. If you want more eyes at launch, the optional Get featured placement puts a labelled Featured card on the home page, game pages and best-of lists.

List your game free →

Common questions

What is the standard cost formula for idle games?

cost = base × rate^owned. The base is the first copy's price and the rate is a number a little above 1, most often between 1.07 and 1.15. Cookie Clicker uses 1.15 for every building; AdVenture Capitalist's first business uses 1.07.

What growth rate should I use for upgrade costs?

Start from the doubling period you want. 1.07 doubles every 10 purchases, 1.15 every 5, 1.24 about every 3. Use lower rates for cheap early generators that should stay relevant and higher rates for premium tiers or late content, then check time-to-afford in a spreadsheet.

How do I calculate the cost of buying 10 or 100 upgrades at once?

Use the geometric series: b × r^k × (r^n - 1) / (r - 1), where b is the base price, r the rate, k the number owned and n the number to buy. For Buy Max, floor(log_r(c × (r - 1) / (b × r^k) + 1)) gives the largest affordable n.

Should idle game costs be exponential or polynomial?

Costs are almost always exponential while production grows linearly or polynomially with ownership, so costs eventually win and new tiers, upgrades or prestige take over. Pecorella's Math of Idle Games series explains why this mismatch is what drives the genre's pacing.

How do idle games handle costs bigger than 1e308?

They switch from JavaScript numbers or doubles to a big-number type that stores a mantissa and exponent, such as break_infinity.js. Antimatter Dimensions uses its own Decimal type and applies extra cost scaling past about 1.8e308.

Sources