Cite as
Cookie Clicker main.js v2.058
Original
https://orteil.dashnet.org/cookieclicker/main.js
sha256
d530a13b6a63034461bb5db25d5c7225bda57d03e49ee24c528e72ff13994fa0
Version
2.058
Archived
https://web.archive.org/web/20260706053619/https://orteil.dashnet.org/cookieclicker/main.js
Accessed
2026-10-20
Licence
All rights reserved. The header reads “All this code is copyright Orteil, 2013-2026” and allows reading it “for educational purposes”. Quoted here a line at a time.
Credit
Orteil and Opti (DashNet). The file header also thanks Nicholas Laux, Debugbro, Opti, the folks at Playsaurus and players on reddit, Discord and the DashNet forums.
Notes
17,359 lines, unminified; every locator is a line in this exact file. main.js holds no version string of its own: the version comes from the page that loads it (index.html line 6, `var VERSION=2.058;`, which loads `main.js?v=13g`). index.html isn't hashed because Cloudflare injects a per-request token into it. The server's Last-Modified (Tue, 13 Jan 2026 21:30:07 GMT) matches the newest changelog entry (“01/13/2026 - housekeeping”, L1451). The Wayback captures of 2026-06-16 and 2026-07-06 decompress to this exact file (same sha256). Local copy: .cache/files/cookie-clicker/main.js.

Cited on

Claims (25)

One global constant, 1.15, multiplies a building's price for each one already owned.main.js L7972Verified
A building's next price is ⌈base×1.15max⁡(0,owned−free)⌉, with discounts applied before rounding.main.js L8090–8095Verified
Free buildings (Starter kit: 10 Cursors; Starter kitchen: 5 Grandmas) come off the exponent, so the next one costs the base price.main.js L8266–8275main.js L3828–3829Verified
Every building after the Cursor gets its base price from one formula on its index n: (n+9+5max⁡(0,n−5)1.75)×10n×max⁡(1,n−14), rounded to two significant figures, then ×10 at id 16, ×100 at 17, ×1,000 at 18, and ×20,000 at 19.main.js L8024–8031Verified
Only the Cursor keeps its Game.Object constructor price; the formula overwrites the rest (the Farm's 500 becomes 1,100).main.js L8003–8034main.js L9104Verified
Base prices (the first one's price) are Cursor 15, Grandma 100, Farm 1,100, Mine 12,000, Factory 130,000, Bank 1.4 million, and so on up to You at 5.4 × 10²⁶.main.js L8979main.js L8024–8031Verified
Base production before upgrades is 0.1 cookies/s for the Cursor, set in its own production function, and ⌈10⋅nn/2+2⌉/10 to two significant figures for building n: Grandma 1, Farm 8, Mine 47, Factory 260, and so on up to You at 5.1 × 10¹⁴.main.js L8018–8022main.js L9104–9109main.js L9001main.js L8912–8916Verified
Each type's production is its count times its stored rate per building, summed into cookies per second, so before upgrades income grows linearly with count.main.js L5276–5285Code
On Grandma income alone, the wait for the next Grandma is 115 s for the 2nd, a low of 38 s for the 8th, and 36 minutes for the 51st.main.js L8090–8095main.js L5276–5285Verified
The shown bulk price is the geometric sum b⋅ra⋅(rk−1)/(r−1), discounted and rounded up once: 20.30× the next single price for 10, and 7.83 million× for 100.main.js L8096–8105Verified
Bulk options are 1, 10, and 100; “All” works only in sell mode and means 100 in buy mode.main.js L8816–8825Code
buy() charges each unit's rounded-up price in turn and ignores the shown total: 10 Grandmas from zero cost 2,035, not 2,031, and 2,030 cookies still buy 9.main.js L8125–8152main.js L8898–8901Verified
Each sale pays 25% of the next one's price, rounded down, about 15% more than the label: selling 1 of 10 Grandmas shows 88 and pays 101.main.js L8156–8176main.js L8106–8123main.js L1620–1628Verified
Upgrades, auras, buffs, and gods multiply the price by factors that don't depend on the count, most of them discounts such as 0.99 or 0.95 and one a rise (the Nasty goblins buff, 1.02), so they scale the curve without changing its 1.15 slope.main.js L8792–8814Code
The changelog dates the launch to 8 August 2013; Orteil says he made the original “in a couple hours, for laughs”.main.js L2020–2021Developer
The changelog's 24 August 2013 “big update!”, which “revamped the whole game (new graphics, new game mechanics)”, falls between two Wayback captures, the original version of 13 August 2013 and v1.035 of 10 September 2013.main.js L2014main.js L2015Developer
The 25 August 2014 “legacy beta, part I” notes say “price and CpS curves revamped”.main.js L1790–1792Developer
The game's About text credits it as “a javascript game by Orteil and Opti”.main.js L1410Developer
The changelog's 1 September 2021 entry announces the Steam release and says web and Steam will get the same updates.main.js L1505–1507Developer
The changelog's 28 September 2019 entry announces the official Android version, with iOS to follow.main.js L1553–1559Developer
A price that grows by a factor of r per purchase doubles every ln⁡2/ln⁡r purchases.main.js L7972Code
With income linear in the count, waits shrink until n=1/(r−1) owned, then each is r⋅n/(n+1) times the last, a ratio that nears r as n grows.main.js L5276–5285main.js L7972Code
A long bulk purchase whose price grows by a factor of r per item costs about r/(r−1) times its last price.main.js L8096–8105Code
In Cookie Clicker (web 2.058), ascending sets the prestige level to ⌊C/10123⌋ for C cookies baked across all ascensions, and each new level adds one heavenly chip.main.js L4185–4188main.js L4196–4206main.js L4312main.js L3712Code
In Cookie Clicker, each prestige level adds 1% to production times a heavenly multiplier that starts at 0; five heavenly upgrades add up to 1 (0.05, 0.20, then 0.25 three times), and the rest of the routine scales it by the Dragon God aura, three Lucky upgrades (×1.01 each), and a god's slot (×0.7, ×0.8, or ×0.9).main.js L5175main.js L4211–4229main.js L5147Code