v0.1 ⌊ALPHA⌉
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 (23)

One global constant, Game.priceIncrease = 1.15, multiplies a building's price for each one already owned.main.js L7972T4
A building's next price is ⌈basePrice×1.15max⁡(0,owned−free)⌉, with discounts applied before rounding.main.js L8090–8095T4
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–3829T4
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.main.js L8024–8031T4
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 L9104T4
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–8031T4
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–8916T4
Each type's production is amount * storedCps, summed into cookies per second, so before upgrades income grows linearly with count.main.js L5276–5285T3
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–5285T4
The shown bulk price (getSumPrice) 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–8105T4
Bulk options are 1, 10, and 100; “All” works only in sell mode and means 100 in buy mode.main.js L8816–8825T3
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–8901T4
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–1628T4
Discounts from upgrades, auras, buffs, and gods multiply the price by constants such as 0.99 or 0.95, lowering the curve without changing its 1.15 slope.main.js L8792–8814T3
The changelog dates the launch to 8 August 2013; Orteil says he made the original “in a couple hours, for laughs”.main.js L2020–2021T2
The changelog's 24 August 2013 “big update!”, which “revamped the whole game (new graphics, new game mechanics)”, falls between the 1.1 and 1.15 captures.main.js L2014–2015T2
The 25 August 2014 “legacy beta, part I” notes say “price and CpS curves revamped”.main.js L1790–1792T2
The game's About text credits it as “a javascript game by Orteil and Opti”.main.js L1410T2
The changelog's 1 September 2021 entry announces the Steam release and says web and Steam will get the same updates.main.js L1505–1507T2
The changelog's 28 September 2019 entry announces the official Android version, with iOS to follow.main.js L1553–1559T2
A price that grows by a factor of r per purchase doubles every ln⁡2/ln⁡r purchases.main.js L7972T4
With income linear in the count, waits shrink until n=1/(r−1) owned, then each is about r times the last.main.js L5276–5285main.js L7972T4
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–8105T4