This guide explains how to enable built-in settings or use third-party extensions to automatically delete all browsing history when you close Safari, Chrome, Firefox, Brave, or Microsoft Edge on your Mac or Windows PC

While you can always clean your web browser history and manage website data in just a few clicks, if you use a shared computer or don’t want cookies, previous session data, and trackers from continuously profiling you, you might want to set this task on auto-pilot.
Once that is done, the list of all the sites you have visited in the last hour, week, month, or all time will be deleted automatically when you quit the web browser. As a result, other people who happen to check your browsing history will see an empty page there. Additionally, this will also log you out of sites you may have logged into, thus further strengthening your privacy on a shared family or office desktop.
Note that while we’re using a MacBook for these steps, the tips here also work if you’re on a Windows PC.
Safari
Safari doesn’t have a built-in option to automatically delete browsing history and data when you exit the web browser. However, there are some alternatives.
Private browsing
If you don’t want your web browser to save your browsing history, the best way is to use Private tabs and windows. It doesn’t save the sites you visit, and site data generated by your private browsing session is cleared automatically after you close the private tab and window. Furthermore, like iOS, your private tabs on macOS are automatically secured by Touch ID or device passcode to prevent unsolicited access.
One disadvantage of private browsing is that it may not play well with logged-in sites even when you haven’t closed your private session. For instance, if you log in to Facebook in a private tab and then try to access Facebook content in a new private tab or window, it may ask you to log in again.
Now that you know the basics, if you’re ready to try private browsing, you can do that by pressing Shift + Command + N in Safari or clicking File > New Private Window from the Safari menu.
You can even set your Safari browser to always open in a Private window:
- Launch Safari and click Safari > Settings or Preferences from the menu bar.
- Make sure you’re in the General tab and set “Safari open with” to “A new private window.”
Remember that this tip isn’t Safari-exclusive, and you can use it on all web browsers, but its name may differ. For instance, Chrome calls it Incognito Window, and in Edge, it’s InPrivate browsing.
Remove history items after a day
While Safari lacks a button to remove all history when you close the browser, it can remove the history after a day, week, two weeks, month, or year. To do that, return to Safari settings and set “Remove history items” to a desired time range, such as “After one day.”
While you’re here, you can also set it to remove download list items (not the actual downloaded file) after one day.
Use Mac’s Guest Mode
Unlike iPhone and iPad, you can set up several user accounts on your Mac. These could be for different family members or office personnel.
In addition to different user accounts, Mac also supports a guest mode. All activity, browsing, and file downloads that happen in guest mode are deleted automatically once the guest session ends.
You can allow guest browsing on your Mac by going to System Settings > Users & Groups > info icon ⓘ next to Guest User and enabling “Allow guests to log in to this computer.”
Chrome
When you close your browser, Google Chrome can automatically clear data that the websites have saved locally to your device. You can enable it in Chrome Settings > Privacy and Security > Site settings > Additional content settings > On-device site data and select “Delete data sites have saved to your device when you close all windows.” However, in my extensive testing, I found that this doesn’t delete your browsing history.
So, the best way to clear all browsing history and data when you quit Chrome is to use a third-party extension like Close & Clean. You’re free to use some other extension from the Chrome Web Store, but make sure to check the ratings and user reviews.
- Add the Close & Clean extension to your browser.
- Click the extensions icon in the upper right side of Google Chrome, and hit the three vertical dots next to this extension name, followed by Options.
- Now, select what you want to delete. For instance, select “Clear browsing history” and “Delete cookies.” You can also define the time frame by choosing “the past hour,” “the dawn of time,” or some other option between these.
- Close this extension settings screen and use the browser.
- When you quit Google Chrome, this extension will automatically delete caches, browsing history, and other things you specify in Step 3.
If you want more options, try the Chrome History Cleaner or Auto Clear Browsing Data extensions to automatically delete your browsing history in Chrome and other Chromium-based browsers.
Brave
Unlike the web browsers mentioned above, the privacy-focused Brave browser offers a native way to clear browsing history and data on exit.
- Open Brave and click the hamburger menu icon in the top right, followed by Settings.
- Select History at the top.
- Click Delete browsing data, and it will open a new tab.
- Go to the “On exit” section.
- Check the box for everything you want your browser to delete when you close it and hit Save.
- From now on, you can use Brave for your web browsing needs, and when you quit the app, it will clear all your browsing history and data as selected in Step 5.
Microsoft Edge
Like Brave, Edge also offers a native way to delete browsing data when you close the app.
- Launch Microsoft Edge and click the three dots menu icon in the top right, followed by Settings.
- Select Privacy, Search, and Services from the left sidebar.
- Scroll to the “Delete browsing data” heading and click “Choose what to clear every time you close the browser.”
- Turn on the switches for Browsing history, Cookies and other site data, and the rest as needed.
- In the future, the app will clear your history and browsing data after you close the app.
Firefox
You can tweak a couple of Firefox settings and have it clear your browsing history, cookies, and site data when you close the browser.
- Launch Mozilla Firefox and click the hamburger menu icon from the top right, followed by Settings.
- Select Privacy & Security.
- Scroll to “Cookies and Site Data” and check the box for “Delete cookies and site data when Firefox is closed.”
- Next, scroll down the same screen until you reach the “History” section. Click the “Firefox will” drop-down menu and set it to “Use custom settings for history,” then check the box for “Clear history when Firefox closes,” and click the Settings button. Check what you want to clear automatically when Firefox closes and hit Save Changes.
The bottom line
To recap, if you don’t want your favorite web browser to keep a log of your browsing activity, you can use the built-in options to clear these automatically.
If your browser doesn’t have this feature baked in, you can use a private browsing window, macOS Guest Mode, or rely on third-party browsing extensions for Chrome, Brave, Edge, and Firefox. I couldn’t find a reliable extension for Safari, so if you come across one, please share it in the comments section below.
Lastly, you can always delete your browser history manually in a few clicks, provided you remember to do that.
But be mindful that deleting previous cookies, cache, and site data will log you out of most sites, which can be inconvenient on a personal computer but helpful on a shared machine. So, make sure you remember your account passwords or save them in a password manager like Apple Passwords or 1Password.
What I do
I use four browsers on my Mac:
- Safari: For banks, payment, and similar websites.
- Chrome: For my everyday work. I use WordPress, Gmail, X (Twitter), Grammarly, etc., here.
- Firefox: To watch YouTube and nearly every other video, as its built-in Picture in Picture is awesome.
- Brave: I have set it to auto-delete past activity and clear recent history on exit. I use this browser for torrents or other sketchy, untrustworthy sites.
Using multiple browsers lets me have the best of all worlds, rely less on third-party browser extensions, segregate my search history, and keep my browsing separated and secure.
Also, check out: How to clear cookies and data of a specific website on Mac and PC