On this page
Your Mac already scans for known malware on its own, and there’s no button to run that scan yourself. What you can do is make sure the built-in scanner is up to date, check the apps you’ve installed, and get a second opinion on a file or folder with free tools. The steps below go from quickest to most thorough.
What macOS scans on its own
XProtect is the malware check built into every Mac. It checks an app when it first opens, when the app changes, and when Apple updates its rules. Apple updates the rules separately from macOS.
XProtect’s background scanner looks for known malware that already got in, and removes it when Apple’s rules describe it. It runs on its own schedule.
Gatekeeper checks that an app from outside the App Store was signed by a registered developer and checked by Apple before it opens. Our guide Do Macs need antivirus software? explains each of these in more detail.
macOS has no command that runs XProtect on a file you choose. The xprotect command in Terminal can show its version and status, but it can’t scan.
1. Check that XProtect is up to date
- Open System Settings > General > Software Update.
- Click the info button next to Automatic updates.
- Make sure Install Security Responses and system files is on.
To see which rules your Mac has, run this in Terminal:
xprotect versionIt prints the version and the date it was installed, such as Version: 5368 Installed: 2026-10-22. A date within the last few weeks means updates are arriving.
2. Check an app’s signature
Gatekeeper’s verdict tells you whether Apple knows who made an app, and whether Apple has checked it. This command asks Gatekeeper about one app. Replace the name with the app you want to check:
spctl --assess --type execute --verbose /Applications/AppName.app| Result | What it means |
|---|---|
accepted source=Apple System |
Part of macOS |
accepted source=Mac App Store |
Installed from the App Store |
accepted source=Notarized Developer ID |
Signed by a registered developer and checked by Apple |
rejected |
Not signed, not checked by Apple, or blocked by Apple |
A rejected app isn’t always malware. Some free and open-source tools aren’t notarized. But an app you can’t identify that’s also rejected is worth removing.
To see who signed an app, run:
codesign -dv --verbose=2 /Applications/AppName.app 2>&1 | grep AuthorityThe first Authority= line names the developer, such as Developer ID Application: AgileBits Inc. for 1Password. A name that doesn’t match the app’s maker is a warning sign.
3. Check a single file with VirusTotal
VirusTotal is a free service that checks a file with more than 70 antivirus engines at once. It’s useful for one download you’re unsure about.
You don’t have to upload the file. Get its fingerprint, called a SHA-256 hash, and search for that instead:
shasum -a 256 ~/Downloads/FileName.dmgCopy the long string of letters and numbers it prints, then paste it into the search box at virustotal.com. If nobody has uploaded the file before, VirusTotal finds nothing, and you can choose whether to upload it.
One or two engines flagging a file is common, even for harmless tools. Read the names of the detections: a generic name from one or two engines means less than the same malware name from many.
4. Scan whole folders with ClamAV
ClamAV is a free, open-source scanner that checks every file in a folder. It takes some setup in Terminal, so it suits people who are comfortable there.
- Install Homebrew if you don’t have it.
- Run
brew install clamav. - Follow the notes Homebrew prints at the end: ClamAV needs its example settings file in
/opt/homebrew/etc/clamav/edited before it can download virus definitions. - Run
freshclamto download the definitions.
Then scan a folder. This scans Downloads and lists only the files it flags:
clamscan -r -i ~/DownloadsCheck the summary at the end. If it says Known viruses: 0, the definitions didn’t download, and the scan checked nothing. Leave out the --remove option: it deletes what it finds without asking.
5. Check the places a scan can’t see
A scanner looks at files. Some of the most common Mac problems aren’t malware files: they’re settings, permissions and browser extensions. Check these too:
- What starts with your Mac: System Settings > General > Login Items & Extensions. Our guide on Mac startup items shows the hidden folders too.
- Browser extensions you didn’t add.
- Device management profiles in System Settings > General > Device Management.
- Apps with special permissions in System Settings > Privacy & Security.
Our guide on how to tell if your Mac has a virus walks through each one.
What a clean result proves
A clean scan means none of the files checked match malware the scanner already knows. It doesn’t prove the Mac is clean. New malware can pass until the rules catch up, and a browser extension or a remote-control app you were talked into installing may not count as malware at all.
Together with step 5, though, a clean result covers the places Mac malware most often shows up.
If a scan finds something
- Search the exact detection name and the file’s name before you delete anything. Harmless tools are sometimes flagged.
- Quit the app the file belongs to, then move it to the Trash.
- Check what starts it in Login Items & Extensions, and turn off its entry. Our guide on how to remove malware from a Mac has the full steps.
- Restart and scan again. Anything that comes back has a startup item you missed.
If you typed your Mac password into a window that appeared after a download, change your Apple Account password from another device as well.
Frequently asked questions
Do Macs have a built-in antivirus?
Yes. XProtect checks apps for known malware when they open and removes known malware in the background. You can’t start a scan yourself, but you can check its rules are current with xprotect version.
How often should I scan my Mac?
XProtect already checks new apps as they open. A manual scan is worth it when something seems wrong, after you’ve installed something you’re unsure about, or when you look after someone else’s Mac.
Are free Mac malware scanners from ads safe?
Be careful with any scanner advertised in a pop-up or a search ad. Some “Mac cleaners” sold that way are adware themselves. Download only from a developer whose site you found yourself.
How can I scan my Mac for malware?
Make sure XProtect is up to date, then use the free checks on this page: an app’s signature, one file on VirusTotal, or whole folders with ClamAV. Malwarebytes for Mac also has a free version that scans on demand.
How do you know if you have malware?
Look for things you didn’t add: startup items, apps with screen or keyboard access, a device profile, or browser extensions. Our guide on how to tell if your Mac has a virus goes through each place.
Sources
- Apple Platform Security, Protecting against malware in macOS.
- Apple Platform Security, Gatekeeper and runtime protection in macOS and App code signing process in macOS.
- Apple Support, Safely open apps on your Mac.
- VirusTotal, How it works.
- ClamAV Documentation, Installing.
- Terminal commands checked on macOS 26.0.1 (25A362) with ClamAV 1.5.4, 2 November 2026.
How we tested. Every step was checked on macOS 26.0.1 (25A362), MacBook Pro (16-inch, 2021), 2 November 2026. Menus and wording can differ on other versions of macOS.