Why you might want to disable JavaScript
JavaScript is a programming language that runs inside your browser and makes websites interactive — it powers dropdown menus, auto-playing videos, live chat boxes, and ads that follow you around the page. Disabling it stops most of that code from running.
The main reason to turn it off is to block tracking and ads. Many advertisers use JavaScript to watch what you do on a website and follow you to other sites. Disabling JavaScript also stops some malicious code from executing if you land on a compromised website, though it is not a complete security solution on its own.
The trade-off is real: many websites will not work at all without JavaScript, or will work only partially. Your email, Google Maps, Netflix, and most modern web applications need it. You will also see broken layouts, missing buttons, and error messages on sites that rely on JavaScript for basic function.
Key Takeaways
- Disabling JavaScript stops ads and tracking code from running, but breaks most modern websites.
- Each browser has its own settings location — Chrome and Edge use the same method, Firefox and Safari differ.
- A practical middle ground is to use an extension like uBlock Origin or NoScript that blocks only ads and trackers, rather than all JavaScript.
- If you disable JavaScript globally, you will need to re-enable it for sites that require it to function.
How to disable JavaScript in Chrome and Edge
Open your browser and go to the address bar. Type chrome://settings/content/javascript (Chrome) or edge://settings/content/javascript (Edge) and press Enter. You will see a toggle that says "Allowed (recommended)" — click it to turn it off.
Once disabled, a lock icon will appear next to the address bar on any site that tries to run JavaScript. You can click that icon and toggle JavaScript back on for just that one site if you need the page to work. The setting will stay off for all other sites until you change it again.
To re-enable JavaScript everywhere, go back to the same settings page and toggle it back on.
How to disable JavaScript in Firefox
Type about:config in the address bar and press Enter. Firefox will show you a warning — click "Accept the Risk and Continue." In the search box that appears, type javascript.enabled.
You will see one result. Click the toggle button on the right side to switch it from "true" to "false". JavaScript is now off. To turn it back on, click the toggle again to change it back to "true".
Firefox does not have a per-site toggle like Chrome and Edge, so if you disable JavaScript globally, you will need to come back to this page to re-enable it for all sites at once.
How to disable JavaScript in Safari
Open Safari and click Safari in the menu bar at the top, then select Settings (or Preferences on older versions). Go to the Security tab. You will see a checkbox that says "Enable JavaScript" — uncheck it.
Close the settings window and the change takes effect when ready. To turn JavaScript back on, go back to the same checkbox and check it again.
Why disabling JavaScript everywhere is usually not practical
Most websites built in the last ten years assume JavaScript is running. Without it, you will see blank pages, missing images, broken forms, and buttons that do nothing. Email services like Gmail, productivity tools like Google Docs, and streaming services like YouTube will not work at all.
If you disable JavaScript globally, you will spend a lot of time toggling it back on for individual sites. A more practical approach is to keep JavaScript on but use an extension to block ads and trackers instead — extensions like uBlock Origin or Privacy Badger do this without breaking website functionality.
Using extensions as an alternative to disabling JavaScript
uBlock Origin is a free extension available for Chrome, Edge, and Firefox that blocks ads and many tracking scripts without disabling JavaScript entirely. Install it from your browser's extension store, and it works automatically — you do not have to change any settings unless you want to.
NoScript is a more advanced option for Firefox and Chrome that lets you choose which scripts run on each site. It has a steeper learning curve because you have to whitelist sites you trust, but it gives you fine-grained control over what code executes.
Privacy Badger, made by the Electronic Frontier Foundation, blocks tracking scripts while leaving other JavaScript alone. It learns which trackers follow you across sites and stops them automatically.
What happens to your data when JavaScript is disabled
Disabling JavaScript does not erase data websites already collected about you. It only stops new tracking from happening going forward. Cookies, browsing history, and information you entered into forms before you disabled JavaScript are still there.
If you want to clear old tracking data, you can delete cookies and site data separately. In Chrome and Edge, go to Settings > Privacy and Security > Clear Browsing Data. In Firefox, go to Settings > Privacy & Security > Cookies and Site Data > Clear Data. In Safari, go to Settings > Privacy > Manage Website Data.
Frequently Asked Questions
Will disabling JavaScript protect me from viruses?
It stops some malicious scripts from running, but it is not a complete defense. Viruses can spread through other methods — email attachments, downloads, and compromised plugins. Disabling JavaScript is one layer of protection, not a substitute for keeping your operating system and browser updated.
Can websites tell if I have JavaScript disabled?
Yes, websites can detect it. Many will show you a message saying "Please enable JavaScript" or straightforward display a blank page. Some sites use this as a basic anti-bot check, so disabling JavaScript may prevent you from accessing them even if you wanted to.
If I disable JavaScript, will my passwords be safer?
Not significantly. Password managers work through browser extensions or built-in features that operate separately from JavaScript. Disabling JavaScript does not make password entry safer — using a strong, unique password and two-factor authentication matter much more.
Do I need to disable JavaScript on my phone?
Mobile browsers handle JavaScript differently than desktop browsers. Most phones do not offer a straightforward on-off switch for JavaScript. If you want to block ads and trackers on mobile, use a browser like Firefox with uBlock Origin, or use a privacy-focused browser like DuckDuckGo or Brave.