How to Optimize Cookie Clicker — Idle Game Math Guide

How to Optimize Cookie Clicker — Idle Game Math Guide

Cookie Clicker was created by Julien Thiennot (Orteil) in August 2013. It’s an idle game — you click cookies, buy buildings, watch numbers go up. Sounds dumb. Is actually a math optimization problem disguised as a game. Here is how to optimize Cookie Clicker: the techniques that take you from ‘I have 10 cookies per second’ to ‘I have a trillion cookies per second.’

Key takeaways

  • Always buy whatever pays for itself fastest: price divided by the cookies per second it adds.
  • Building upgrades that double output are usually the best value on screen once you own a handful of that building.
  • Click every golden cookie, and keep a bank big enough for Lucky to pay out in full.
  • Save for a new building tier when it is close instead of buying one more copy of a cheap building.

The basic loop

Click the giant cookie to bake 1 cookie. Use cookies to buy buildings (Cursor, Grandma, Farm, Mine, Factory, etc.). Each building produces cookies passively. More buildings = more cookies per second.

Each building costs 15% more than the previous one of its type. So the first Cursor costs 15 cookies, the second costs 18, and the 20th costs about 214. The cost grows exponentially.

That 15% rule is the whole reason optimization matters. Production from a building type grows in a straight line with each copy, but its price grows exponentially, so every building type eventually becomes a bad deal and you have to move on to the next one.

Optimization principle 1: Compare CPS-per-cookie

Every building has a Cookies Per Second (CPS) and a cost. The most important metric: CPS per cookie spent. Higher is better.

Example: Building A produces 1 CPS for 100 cookies (0.01 CPS/cookie). Building B produces 10 CPS for 1,000 cookies (0.01 CPS/cookie). They’re equivalent at this scale.

As building counts grow, ratios shift. As a rule, buy the building with the best CPS/cookie ratio at any given moment — the same idea as picking the purchase that pays for itself fastest.

Turn it into payback time

Flip the ratio over and you get an easier number to compare: payback time = price ÷ CPS added. It tells you how many seconds a purchase takes to earn back what it cost. Lowest payback wins.

Here is the first copy of each generator in our Cookie Clicker, before any upgrades:

GeneratorFirst priceBase CPSPayback (first copy)
Auto Cursor150.1150 s
Grandma1001100 s
Farm1,1008about 138 s
Mine12,00047about 255 s
Factory130,000260500 s
Bank1.4 million1,4001,000 s
Temple20 million7,800about 2,564 s
Wizard Tower330 million44,0007,500 s

Each copy you own multiplies the next copy’s payback by 1.15. A worked example: your 8th Grandma costs about 2.7 times the first one, so its payback is roughly 266 seconds. Your first Mine pays back in about 255 seconds, so once you own seven Grandmas, the Mine is the better buy even though it is far more expensive.

Optimization principle 2: Upgrades trump buildings (usually)

Each building has upgrades (Reinforced Index Finger for Cursors and clicks, Forwards from Grandma for Grandmas) that typically double that building’s output. These are massive.

Rule of thumb: if an upgrade costs less than about 30 minutes of your current CPS, buy it. The break-even is fast.

The same payback math works here. A doubling upgrade adds exactly what that building type currently produces, so its payback is upgrade price ÷ that building’s current total CPS. In our version, Forwards from Grandma costs 1,000 cookies. With 10 Grandmas making 10 CPS, it adds 10 CPS and pays back in 100 seconds, better than any building in the table. With only one Grandma it would take 1,000 seconds. That’s why upgrades get better the more copies you own.

Optimization principle 3: Golden cookies

Golden cookies appear randomly. Clicking them gives bonus effects, including Lucky (an instant payout of 15% of your banked cookies, capped at 15 minutes of production), Frenzy (CPS ×7 for 77 seconds) and Click Frenzy (clicking power ×777 for 13 seconds).

Click golden cookies as soon as you see them. Keep a healthy bank so Lucky pays out its maximum, and click the big cookie hard during Click Frenzies.

How big should your bank be?

The Lucky math gives you a target. Lucky pays the smaller of 15% of your bank or 15 minutes of CPS, and those two are equal when your bank holds 100 minutes of CPS. Below that, you’re leaving Lucky payouts on the table. Above it, the extra cookies earn nothing sitting in the bank.

Because a Frenzy multiplies CPS by 7, a Lucky that lands during a Frenzy is capped seven times higher. Players who chase that combo keep a bigger bank. If you’re not watching the screen much, the plain 100-minute bank is the simpler target.

Optimization principle 4: Don’t ignore cheap clickers

Cursor (the basic building) seems insignificant but scales surprisingly well: its later upgrades make each Cursor earn more for every other building you own.

Don’t ignore Cursors. Keep buying them alongside your other buildings once those upgrades are in place.

Optimization principle 5: The hard part is patience

Past the first hour of play, the game becomes mostly idle. Buildings produce cookies in the background. The optimization decisions are: buy now or save up for the next building tier.

Save up for the next building tier when it’s within reach. Don’t waste cookies on Cursor 100 when your first Bank (a new tier) is close.

A quick test: if waiting for the better item takes less time than the cheaper item’s own payback, wait. A cheap purchase that needs 20 minutes to earn itself back isn’t worth delaying a much better one by even a few minutes.

A simple Cookie Clicker buy order routine

Put the principles together and every shopping trip looks like this:

  1. Buy any upgrade that costs less than about 30 minutes of current CPS.
  2. Otherwise compare payback times for the next copy of each building and buy the lowest.
  3. If something with a clearly better payback is only a few minutes away, wait for it.
  4. In the full game, keep about 100 minutes of CPS banked once golden cookies show up.
  5. Click every golden cookie you see, and save your manual clicking for Click Frenzies.

Early on, active clicking matters a lot, so buy the cheap click upgrades first. Once buildings out-earn your clicks many times over, stop worrying about clicking and play the shop.

Advanced: Sugar Lumps and Heavenly Chips

Sugar Lumps unlock once you’ve baked a billion cookies, and ascending (prestige) converts your progress into heavenly chips and permanent bonuses. These compound your gains. The full game has hundreds of upgrades, achievements, and meta-mechanics.

Three late-game levers are worth knowing about:

  • Building levels and minigames. Spending a sugar lump to level up certain buildings unlocks a minigame: the Farm’s garden, the Bank’s stock market, the Temple’s pantheon and the Wizard Tower’s grimoire of spells.
  • Achievements and milk. Achievements raise your milk level, and Kitten upgrades turn milk into a CPS multiplier, so unlocking achievements pays off directly.
  • Ascension timing. Heavenly chips depend on everything you have baked in total, and the first heavenly upgrade, Legacy, unlocks the prestige bonuses. Common advice is not to rush your first ascension: wait until the reset gives you enough chips for Legacy plus some early heavenly upgrades.

Our Cookie Clicker late-game guide goes deeper into these systems. Before you experiment, export your save so you can roll back.

If you want to play seriously, the official Cookie Clicker is free on the web at orteil.dashnet.org, and a paid Steam version ($4.99) adds a C418 soundtrack, Steam achievements and cloud saves. Wikipedia’s Cookie Clicker article covers the game’s background.

Practice

Play our Cookie Clicker, a simplified take on the format. It auto-saves every 5 seconds and has eight generators and a set of x2 upgrades, so it’s a quick way to practice the buy-order math above.

Know what is and isn’t in it: there are three click doublers (Reinforced Index Finger, Carpal Tunnel Prevention, Ambidextrous) and doublers for Cursors, Grandmas, Farms, Mines and Factories. There are no golden cookies, sugar lumps or ascension, and cookies only accumulate while the page is open. Bank, Temple and Wizard Tower have no upgrades, so late in a run the payback table above is the whole decision.

Frequently asked questions

What is the best thing to buy in Cookie Clicker?

Whatever has the lowest payback time: its price divided by the cookies per second it adds. Upgrades that double a building you own many of usually win; otherwise compare the next copy of each building.

Should I click or idle in Cookie Clicker?

Click early, when buildings produce little, and during Click Frenzies. Later, buildings out-earn manual clicking by a wide margin, and checking in to click golden cookies matters far more than clicking the big cookie.

How many cookies should I keep in the bank?

About 100 minutes of your current CPS. At that point 15% of your bank equals 15 minutes of production, so a Lucky golden cookie pays out its full capped amount.

When should I ascend for the first time?

Not immediately. Heavenly chips grow with your total cookies baked, so most players wait until a reset buys Legacy and a few early heavenly upgrades. Your later runs then go much faster than the first.

Do Cursors matter later in the game?

Yes. In the original game, Cursor upgrades later in the tree add output for every other building you own, so Cursors stay useful long after they look obsolete.

Related reading

Need a break from the numbers? The Chrome Dino game is one button and zero math.

🔌 Connect any AI assistant to dinogame.gg — we run an MCP server: https://dinogame.gg/mcp