DEV Community

Cover image for How I Hacked Cookie Clicker Game with Inspect Element 2025
Muhammad Furqan Ul Haq
Muhammad Furqan Ul Haq

Posted on • Updated on

How I Hacked Cookie Clicker Game with Inspect Element 2025

How I Hacked Cookie Clicker Game with Inspect Element

Cookie Clicker is a very popular browser-based game. It revolves around producing cookies for the world. This game gets more interesting over time which keeps the player engaged.

Basically, there are a few ways to get cookies. These cookies can then be used to create new buildings or purchase upgrades. At first, I’m going to mention a few genuine ways to earn cookies.

  • By clicking the big “Cookie” shown on the user interface.
  • By creating new buildings. There are different types of buildings and each type can only produce a specified number of cookies per second. Initially, all buildings are locked, but they will get unlocked over time as the game progresses.
  • By enhancing the efficiency of your cookie store through upgrades.

I would like to mention here that in the past I wrote a very popular article about the best open-source HTML Games. I think the source code of these games will help you improve your game development/hacking skills. So, please do have a look.

Now, here comes the actual hacking stuff you’re waiting for.

Getting Started

As I mentioned earlier, this is a browser-based game. Meaning that it is developed using HTML5, CSS3, and JavaScript. All of these are client-side languages that can be modified through programs like Chrome DevTools.

Let’s open this game in Google Chrome.

Now to open Chrome DevTools, right-click anywhere on the game and select “Inspect” from the context menu. For now, we will only be focusing on its functionality that is written in JavaScript. So, open the “Console” tab.

Another way is to press Ctrl+Shift+J on Windows or ⌘+⌥Option+J on Mac.

You’ve to execute the below-mentioned codes here.

It’s time to hack different features of this Cookie Clicker game.

Hack Cookies

As everything in this game depends on cookies, so I hacked them!

Basically, after analyzing its source code, I found that the functionality of this game is written inside a file called “main.js”.

This file initializes an object Game through which we can easily access different features of Cookie Clicker. For example, we can modify the number of cookies we have using the Game.cookies property.

Let’s do that now!

Simply copy the below code and paste it inside the “Console” tab of Chrome DevTools. Press “Enter” to execute it.

Game.cookies = 57000
Enter fullscreen mode Exit fullscreen mode

Once executed, you will get 57000 cookies absolutely FREE. You can add any number here.

For example, the below code will give you “Infinity Cookies”.

Game.cookies = 999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999
Enter fullscreen mode Exit fullscreen mode

Keep Getting Cookies

This game also has the functionality of earning cookies per second. Game.cookiesPs property will give us a specified number of cookies for one second.

So, why not wrap it inside a setInterval of one second to continuously get more and more cookies?

Here’s the code snippet to do so.

setInterval(function(){
    Game.cookiesPs = 50
}, 1000);
Enter fullscreen mode Exit fullscreen mode

This code will add 50 cookies to your account every second.

Unlock All Upgrades and Purchase Them

Finally, the developers of Cookie Clicker have also provided a cheat to get all upgrades for free.

Basically, the below method will give you all upgrades as well as unlocks all types of buildings. Additionally, you will get 1.000 nonillion cookies.

Game.RuinTheFun();
Enter fullscreen mode Exit fullscreen mode

Now you might be wondering can we hack other browser-based games too?

And the answer is "Yes, definitely!"

You can hack any game no matter whether it is browser-based, Android, or even PC.

I would like to mention that I learned game hacking from guidedhacking.com. It is the best community forum that helps us understand all the concepts of game hacking in a step-by-step manner.

Spend some time there!

You'll find game hacking tutorials and guides right from their main menu. If you find something difficult then you can always ask questions from fellow hackers.

At last, I would say that game hacking is not very difficult. It just depends on how much time you can dedicate to learn it.

Top comments (42)

Collapse
 
trantien18 profile image
Super Mario Bros Game • Edited

I usually play cookie clicker on: cookie clicker
And can play more and more io games in one place. no need to find more.

Collapse
 
johnsmith9902 profile image
johnsmith9902

Login to thanks you, i can spend hours to play game on this site.

Collapse
 
basketballlegends profile image
Basketball legends • Edited

What games would you recommend. My favorite game is the basketball legends unblocked game. It's really fun.

Collapse
 
proprogrammer2432 profile image
ProProgrammer2432 • Edited

DUDE THE LAST COMMAND GAVE ME BUG IN THE GAME
dev-to-uploads.s3.amazonaws.com/up...

Collapse
 
trulyfurqan profile image
Muhammad Furqan Ul Haq

By "bug" did you mean error or the insects that are eating cookies?

Collapse
 
proprogrammer2432 profile image
ProProgrammer2432

insects that are eating cookies

Collapse
 
joshuaw94244563 profile image
Baby._.Steve

ME TOO IT SUCKS THAT LAST ONE

Collapse
 
proprogrammer2432 profile image
ProProgrammer2432

I KNOW RIGHT!!!!!

Collapse
 
basketballlegends profile image
Basketball legends

It's a really incredible trick, I can make a little joke to my friends :)

Collapse
 
kirilllive profile image
Kirill Live

It was interesting, I didn’t know that Cookie Clicker works like that.

Collapse
 
trulyfurqan profile image
Muhammad Furqan Ul Haq

Yeah. It is a very engaging game. I really like the way it progresses.

A few years ago, I hacked Google Chrome's Dinosaur Game and published a blog post on it. That article got really popular. So, today I decided to try hacking this Cookie Clicker. 😉

Here's a link to the "Dinosaur Game Hacked" article if you're interested.

link: JavaScript Code Plays Google Dinosaur/T-Rex Game Automatically

Collapse
 
carlvcarpenter profile image
carlvcarpenter

My favorite game is usually brain teasers and attention games.
mahjong free

Collapse
 
patthememestealer profile image
Comment marked as low quality/non-constructive by the community. View Code of Conduct
Info Comment hidden by post author - thread only accessible via permalink
patthememestealer

dont say you hacked it you because you didn't

Collapse
 
miavardy profile image
Mia

Dive into a colorful world where blocks are the foundation of your creativity. In minibloxgame.com, the goal is to collect resources, build structures, and explore the landscape. Players must gather materials and craft tools to survive and expand their territory. The game offers endless opportunities for creative expression, making it a fun and engaging experience for all.

Collapse
 
eileenjmartinez profile image
eileenjmartinez

I can play Cookie clicker without getting bored, but after a while I'm really tired of clicking, so I play basketballlegendsunblocked for him.

Collapse
 
fornoairfryer profile image
Air Fryer

Considering purchasing one is challenging to decide due to the many possibilities. We have chosen the best air fryer to help you select the ideal appliance for cooking. Click here to buy air fryer.

Collapse
 
proprogrammer2432 profile image
ProProgrammer2432
Collapse
 
fornoairfryer profile image
Air Fryer

Considering purchasing one is challenging to decide due to the many possibilities. We have chosen the best air fryer to help you select the ideal appliance for cooking. Click here to buy air fryer.

Collapse
 
basketballlegends profile image
Basketball legends

My hand was hurting from clicking the mouse. I hope this game trick works. basketballlegendsunblocked

Some comments may only be visible to logged-in visitors. Sign in to view all comments. Some comments have been hidden by the post's author - find out more