JavaScript is on by default in Safari, but you can turn it back on if you've disabled it

Safari enables JavaScript automatically when you install it. If a website isn't working properly — buttons don't respond, pages won't load fully, or interactive features freeze — JavaScript might be turned off. Turning it back on takes about 30 seconds and requires only the Safari menu and one settings screen.

JavaScript is a programming language that websites use to make things interactive: forms that validate what you type, maps you can drag around, videos that play on demand, and chat boxes that respond without reloading the page. Without it, many modern websites fall back to basic versions or stop working entirely. Disabling it is rare, but it happens when you change settings deliberately or when a security tool does it for you.

Key Takeaways

  • JavaScript is enabled in Safari by default, so you only need to turn it on if you deliberately turned it off or a security tool disabled it.
  • To enable JavaScript, open Safari, click Safari in the menu bar, select Preferences, go to the Security tab, and check the box next to "Enable JavaScript".
  • After enabling JavaScript, refresh the website you were viewing by pressing Command+R or clicking the refresh button.
  • If a website still doesn't work after enabling JavaScript, the problem is usually with that specific site, not with your browser settings.

Steps to turn JavaScript on in Safari

Open Safari and click Safari in the menu bar at the top of your screen. A dropdown menu appears. Click Preferences (or Settings on newer versions of macOS). A new window opens.

Click the Security tab at the top of the Preferences window. You'll see a checkbox next to "Enable JavaScript". If the box is empty, JavaScript is off. Click the box to enable it. If the box already has a checkmark, JavaScript is already on — the problem lies elsewhere.

Close the Preferences window. Go back to the website that wasn't working and refresh the page by pressing Command+R on your keyboard, or by clicking the refresh arrow button in the address bar. The page should now load with JavaScript active.

Why websites need JavaScript to work

Modern websites rely on JavaScript to handle tasks that happen in your browser without sending information back to the website's server every time. When you type in a search box and see suggestions appear instantly, that's JavaScript. When you click a button and a menu slides open, that's JavaScript. When you watch a video embedded on a page, that's usually JavaScript controlling the player.

Without JavaScript, websites can still show text and images, but interactive features break. Forms might not submit. Buttons might not respond. Pages might not update when you scroll. Some websites will show you a message saying "JavaScript is required" and refuse to load at all.

When JavaScript might be disabled without you knowing

Most people never disable JavaScript deliberately. It's usually turned off by security software, parental controls, or accessibility tools that someone else installed on your computer. If you share your Mac with family members, one of them might have changed the setting. If your computer is managed by a workplace or school, an administrator might have disabled it across all browsers.

If you've enabled JavaScript but websites still aren't working, check whether you're using a browser extension that blocks scripts. Extensions like uBlock Origin, Privacy Badger, or NoScript can disable JavaScript on specific sites or everywhere. Look in your Safari Extensions settings (Safari menu > Preferences > Extensions) to see what's installed and whether any extension has permission to block content.

What to do if enabling JavaScript doesn't fix the problem

After you enable JavaScript and refresh the page, try clearing your browser cache. Click Safari in the menu bar, then select Clear History. Choose "all history" from the dropdown menu and click Clear History. This removes stored copies of websites that might be outdated or corrupted.

If the website still doesn't work, the problem is usually with that specific website, not with your Safari settings. Try the same website in a different browser like Chrome or Firefox to confirm. If it works in another browser, contact the website's support team and tell them what's happening. If it doesn't work in any browser, the website itself might be having technical problems.

Checking whether JavaScript is actually on

To confirm that JavaScript is enabled, visit a website that uses it heavily, like Google Maps, YouTube, or Gmail. If these sites load and work normally — you can drag the map, play videos, or see your inbox — JavaScript is on. If you see error messages or the page looks broken and incomplete, JavaScript might still be off or blocked by an extension.

Another way to check is to open any webpage, right-click on it, and select Inspect. The developer tools panel opens at the bottom. Click the Console tab. If you see red error messages that mention "JavaScript is disabled" or "script error", JavaScript is off or blocked. If the console is empty or shows normal messages, JavaScript is working.

Frequently Asked Questions

Is it safe to have JavaScript enabled?

Yes. JavaScript runs only on websites you visit and can't access your files or install software. Malicious websites can use JavaScript to track you or try to trick you, but the same risks exist with JavaScript off. Keeping your browser and operating system updated protects you far more than disabling JavaScript does.

Will enabling JavaScript slow down Safari?

No. JavaScript might make individual websites load slightly slower if they use it heavily, but disabling it won't speed up your browser overall. Modern Macs handle JavaScript easily. If Safari feels slow, the problem is usually too many open tabs, a slow internet connection, or a website with poor code.

Do I need to restart Safari after enabling JavaScript?

No. You only need to refresh the webpage you were viewing. Press Command+R or click the refresh button. The page will reload with JavaScript active immediately.

Can I enable JavaScript for only certain websites?

Safari doesn't have a built-in way to allow JavaScript on some sites and block it on others. If you need that level of control, you'd need a browser extension like NoScript, but most people don't need it. Enabling JavaScript globally is the standard approach.