To turn off JavaScript on an iPhone, open Settings, tap Apps, tap Safari, tap Advanced, and turn off JavaScript. Flip the same switch to turn it back on.
These steps match iOS 27 and iOS 18 or later, and iPad uses the same path. On iOS 17 and earlier, including an iPhone 6 on iOS 12, Safari is in the main Settings list and the rest is the same. The switch only affects Safari. Other browsers you install, such as Chrome or Firefox, have their own settings.
How to Turn JavaScript Off (or On) in Safari
- Open the Settings app.
- Scroll down and tap Apps. On iOS 17 and earlier, skip this step and tap Safari in the main list.
- Tap Safari. Safari’s settings open.
- Scroll to the bottom and tap Advanced.
- Tap the JavaScript switch. Gray means off and green means on.

The change takes effect without a restart. To confirm it, reload a page with menus or a sign-in form in Safari. Buttons that open menus or forms that check your entry should stop responding. Apple lists the same path, with the switch turned on, as a fix in its guide to what to do when Safari isn’t loading websites.
Why Turn JavaScript Off?
JavaScript is the code that makes web pages interactive. People turn it off to test whether a script is making a page freeze, to read a cluttered page without animations and pop-up banners, or to see how their own site looks to visitors who block scripts. It doesn’t harm your iPhone or delete data, but it isn’t a complete privacy or security tool either.
If you browse in Edge instead of Safari, Edge has its own setting to block ads in Microsoft Edge on an iPhone.
What Stops Working With JavaScript Off
The setting applies to every site in Safari. With it off, menus and buttons may do nothing, sign-in and checkout forms may not submit, and video players, maps, and comments may not load. Banking and shopping sites usually need JavaScript, so turn it back on before you use them, and when you finish testing.
Can You Turn Off JavaScript for One Website?
Not in Safari’s settings. Apple doesn’t list a per-site JavaScript option, and Website Settings in Safari covers items such as camera, microphone, and location instead. Two alternatives:
- Reader shows an article’s text and photos without most menus and ads, and leaves JavaScript on for other sites. Try Reader mode in Safari on iPhone for articles.
- Content blockers from the App Store are Safari extensions that can block scripts or ads. If one breaks a site, try turning off that Safari extension for the site first.
Better Options for Common Problems
Each of these is in Settings > Apps > Safari:
- Too many pop-ups: turn on Block Pop-ups. Apple also suggests turning on Fraudulent Website Warning, which warns you about suspected phishing sites. Firefox has its own separate switch. Here’s how to allow or block pop-ups in the Firefox iPhone app.
- Tracking: keep Prevent Cross-Site Tracking on. See also how to limit ad tracking on iPhone.
- A site is acting strange: tap Clear History and Website Data, then Clear History. To remove website data only, follow the steps for clearing the cache on iPhone.
- Camera, microphone, or location requests: set Camera, Microphone, and Location to Ask, Deny, or Allow. See denying camera access to websites on an iPhone.

If a pop-up takes over the screen, Apple’s pop-up guide says not to tap it, since some have fake close buttons. Type a new address in the search field or close the tab instead.
Need Even Stronger Protection?
Lockdown Mode is an extreme protection for the very few people who might be personally targeted by sophisticated attacks. It blocks certain complex web technologies, so some sites may load slowly or not work. Turn it on in Settings > Privacy & Security > Lockdown Mode. Unlike the JavaScript switch, it lets you exclude trusted sites: in Safari, open the page menu, tap Website Settings, and turn off Lockdown Mode for that site.
Troubleshooting
- There’s no Apps item in Settings. Your iPhone runs iOS 17 or earlier. Tap Safari in the main Settings list.
- Sites still break after you turn JavaScript back on. Restart your iPhone, try another network, check your VPN, and clear website data. Apple also suggests checking iCloud Private Relay.
- The switch won’t stay on. An iPhone managed by a school or employer can have Safari settings set by the organization. Ask its IT administrator.
Frequently Asked Questions
Does turning off JavaScript in Safari affect other apps?
The switch is a Safari setting only. Chrome, Firefox, and other browsers you install keep their own settings, so turning JavaScript off in Safari doesn’t change them.
Is JavaScript on by default on iPhone?
Yes. Safari runs JavaScript unless you turn the switch off.
How do I turn JavaScript back on?
Go to Settings > Apps > Safari > Advanced and turn on JavaScript. The switch turns green, and pages work normally after you reload them.
Related: how to block or allow cookies on iPhone, how to change the Safari search engine, and how to disable JavaScript in Adobe Reader if PDFs are your concern.

Matthew Burleigh is the founder, head writer, and editor of Solve Your Tech, which he launched in 2012. He has written technology tutorials since 2008 and worked in IT since 2003, including small-business support, IT management, and consulting. He holds Bachelor’s and Master’s degrees in Computer Science from Arizona State University.
Matthew writes practical guides for Windows, iPhone and iPad, Microsoft Office, Outlook, Google apps, and Android. Solve Your Tech’s guides are checked step by step against the device or app maker’s own documentation and tested on his own devices whenever he has the hardware or software, with clear steps, sources, and update dates.
Read more about Matthew and how Solve Your Tech writes and updates its guides, or report a correction.