Safari Data Tool

See and clear the storage Safari uses for each website.

Install

Click to copy · paste in Terminal

What is it?

A command-line tool for macOS that helps you see and manage the storage Safari uses for individual websites.

Safari saves data from websites you visit, such as cached files and other browsing data. Over time, some websites can take up gigabytes of storage without you realizing it. This tool helps you find out which websites are using the most space and clean up their stored data when needed.

What does it do?

The tool scans Safari's stored website data, identifies which websites each folder belongs to, and shows how much disk space each website uses, including all files in its folders and subfolders.

You can then choose a specific website and delete its stored data to free up space. A confirmation step helps prevent accidental deletions.

⚠️ Full Disk Access

Safari's container is protected by macOS TCC. The terminal application you run the tool from must be granted Full Disk Access in System Settings > Privacy & Security > Full Disk Access.

Without this permission the Safari container reads as empty: the tool sees zero folders and reports an empty listing with a message that this likely requires Full Disk Access. If you see that, grant access to your terminal app, then quit and reopen the terminal so the new permission takes effect.

I can do the same thing from Safari's GUI, can't I?

True, you can delete any website's data via Safari > Settings > Privacy > Manage Website Data. There's a significant caveat, though: the list is sorted alphabetically, and Safari doesn't show how much data is associated with each website.

Of course, you can use this tool to scan the folders and then remove the data for a particular website through Safari's settings instead.

Can I undo a deletion?

No. Clearing a folder permanently deletes the website's data. There's no undo, and nothing is moved to the Trash. Once a domain's data has been cleared, it cannot be recovered.

The small origin metadata marker and the folder itself remain, so the folder can still be identified, but the data is gone. Always double-check the domain or hash before confirming a deletion, especially when using --force, which clears the data without prompting for confirmation.

Is the tool open source?

Absolutely! You can find it on GitHub and modify it to suit your needs. The tool is released under the MIT License.