How to Make an Idle Clicker Game
Idle games are mostly math. Get the cost curve, the prestige formula and offline progress right, and the numbers do the rest.

Key takeaways
- Each generator costs base × growth^owned. Growth around 1.07 to 1.15 is the classic range.
- Prestige resets progress for a currency that grows with the square root (or a similar root) of lifetime earnings, so each reset is faster.
- Offline progress is elapsed time × income per second, capped, computed on load. Never simulate it tick by tick.
An idle clicker game is a loop of buying things that make money so you can buy more expensive things that make more money. To build one you need four formulas: an exponential cost for each generator, multipliers that reward milestones, a prestige reset that grows long-term progress, and offline earnings calculated when the player returns. Get those right and an AI builder can do the rest from a short brief. This guide gives you the formulas with numbers you can start from.
The cost curve is the whole game
Every generator (a lemonade stand, a cursor, a mine) has a base cost and a growth rate. The price of the next one is `base × growth^owned`. Cookie Clicker uses a growth rate of 1.15 for its buildings; many other idle games sit lower, around 1.07 to 1.12. Lower growth means players buy more of each generator before moving on.
Production grows linearly with the count you own, while cost grows exponentially. That mismatch is the engine of the genre: each generator becomes a worse deal over time, which pushes the player toward the next, more expensive tier. Space tiers so each costs roughly 8 to 12 times the previous one’s base cost and produces around 5 to 8 times as much. The next tier should look slightly out of reach, never absurd.
Buy x10 and buy max
Players will want to buy in bulk. The cost of buying n more when you own k is a geometric series: `base × growth^k × (growth^n − 1) ÷ (growth − 1)`. “Buy max” solves that for the largest n you can afford. Ask the agent to use the formula rather than a loop that buys one at a time, which gets slow at large counts.
Milestones and multipliers
Pure exponential costs eventually feel like a wall. Milestones break the wall: owning 25, 50, 100, 200 of a generator doubles (or triples) its output. AdVenture Capitalist made this pattern famous. It creates natural goals (“just 7 more to 100”) and makes the player’s favorite generator stay relevant longer.
- Milestone multipliers: ×2 at 25, 50 and 100 owned, ×3 at 200 and beyond.
- Upgrades: one-time purchases like “cursors are twice as efficient”, priced well above the generator itself.
- Managers or automation: in games that start as clickers, a purchase that makes a generator run without tapping. This is the moment the game turns idle.
- Achievements: each gives a small permanent bonus (say +1 percent income), which makes collecting them part of progression.
Prestige: the reset players want
After a while every run slows to a crawl. Prestige lets the player wipe their generators in exchange for a permanent currency that multiplies future income. The second run reaches the same point in a fraction of the time, and then goes further.
A common formula: prestige currency = `floor(k × sqrt(lifetime earnings ÷ scale))`, minus what the player already has. Each prestige point might add 2 percent to all income. The square root (or cube root, for a slower game) matters: doubling your earnings does not double your prestige, so pushing further is worth it but has diminishing returns. Show the player how much prestige they would get right now and how much income it would add, so the choice of when to reset is informed. That decision is the most interesting one in the whole genre. The core game loop guide explains how a reset like this feeds the loops inside it.
Offline progress without cheating yourself
Idle games earn while closed. Do not simulate missed time tick by tick: compute it. On save, store a timestamp and the current income per second. On load, `earned = income per second × min(seconds away, cap) × offline rate`.
- Cap: 8 to 24 hours is typical. A cap gives a reason to check in daily without punishing a weekend away.
- Offline rate: some games pay 100 percent, others 25 to 50 percent with an upgrade to raise it.
- Welcome back screen: “While you were away, your mines earned 4.2M.” This screen is the reward that brings people back. Make it a moment.
- Clock tricks: players can move their device clock forward. For a single-player game you can mostly accept it; if you add leaderboards, take the time from a server (Startbase Cloud’s database can store saves and times, see the Cloud docs).
Save often: every 10 to 30 seconds, and whenever the tab is hidden (the browser’s visibilitychange event), because mobile browsers kill background tabs without warning. Saving game progress covers save versions, so an update never wipes a long run.
Formatting numbers that outgrow JavaScript
JavaScript numbers are precise up to about 9 quadrillion (2^53) and overflow to Infinity around 1.8 × 10^308. Idle games pass the first early and many pass the second. Plan for both:
- Display: short suffixes up to trillions (1.23K, 45.6M, 7.89B, 1.2T), then either letter pairs (aa, ab, ac) or scientific notation (1.23e15). Let players choose; many prefer scientific.
- Three significant digits: “1.23M”, not “1,234,567”. Numbers that change every frame must not jiggle in width, so use a monospaced or tabular font for counters.
- Past 1e308: use a big-number library such as break_infinity.js, which stores a mantissa and exponent. Decide this before you have saves in the wild, since switching later means migrating them.
The brief to paste
An idle clicker game about a tiny moon mining colony, portrait for phones. Tap the moon to mine dust by hand. Eight generators from Shovel Bot (base cost 15, produces 0.1/s) up to Core Drill, each tier costing about 10 times the last and producing about 6 times as much. Cost of the next one is base × 1.12^owned. Buttons for buy 1, buy 10 and buy max using the geometric sum formula. Output doubles at 25, 50 and 100 owned. Prestige “Launch to a new moon” becomes available at 1M lifetime dust and gives stardust = floor(sqrt(lifetime ÷ 1e6)); each stardust adds 2 percent to all income; show the gain before confirming. Save to the device every 15 seconds and when the tab is hidden. Offline earnings for up to 12 hours at 50 percent, with a welcome back screen. Numbers with 3 significant digits and suffixes, with a setting for scientific notation.
Pacing problems to watch for
- The early wall. If the player waits more than a minute for anything in the first ten minutes, they leave. Early purchases should come every few seconds.
- Nothing to do while active. Give tapping a real value early (or a bonus spawn to tap), so an engaged player progresses faster than an idle one.
- Invisible progress. Show income per second, time to the next purchase and progress to the next milestone.
- Prestige too late or too weak. If the second run is not clearly faster, players feel cheated. Test it yourself: time a first run to prestige, then a second.
Use the engine panel’s dials to tune growth rates and income live while the game runs (see the games template docs), then publish and watch how long people stay. For more ideas you can finish in a weekend, see app ideas you can build this weekend. Idle games suit rewarded ads, which monetizing a web game compares with other options.
Frequently asked questions
What formula do idle games use for costs?
Most use cost = base × growth^owned, with growth between about 1.07 and 1.15. Cookie Clicker uses 1.15 for its buildings. The exponential cost against linear production is what pushes players to new tiers.
How does offline progress work in idle games?
The game stores a timestamp when it saves. When the player returns, it multiplies the time away (up to a cap) by income per second and often by an offline rate below 100 percent, then shows the total on a welcome back screen.
How do idle games handle huge numbers?
They format numbers with suffixes or scientific notation, and once values pass about 1.8e308 (the JavaScript limit) they use big-number libraries that store a mantissa and an exponent.
When should prestige unlock?
Early enough that most players see it, often within the first 30 to 60 minutes. The second run should be noticeably faster than the first.

