Quick answer: The quickest way to scan a file for malware on Windows is to right-click it and choose Scan with Microsoft Defender. For a second opinion, upload the file to VirusTotal, which checks it against dozens of antivirus engines at once, and on a Mac lean on the built-in Gatekeeper and XProtect protections plus Defender or a VirusTotal upload.
You downloaded something, an installer, a PDF, a file a stranger emailed you, and now a little voice is asking whether it is safe to open. That instinct is worth listening to. Scanning a file before you run it takes under a minute and can save you from ransomware, spyware, or a drained bank account. This guide shows you exactly how to scan a file for malware on Windows and Mac, plus how to get a powerful second opinion for free.

How to scan a file for malware: methods at a glance
There is no single “best” scanner, because the right tool depends on your device and how suspicious the file is. Here is a quick comparison of the reliable options.
| Method | Platform | Cost | Best for |
|---|---|---|---|
| Right-click “Scan with Microsoft Defender” | Windows | Free (built in) | A fast local check of any file or folder |
| VirusTotal upload | Any (web) | Free | A second opinion across many engines |
| Gatekeeper / XProtect | Mac | Free (built in) | Automatic checks when opening apps |
| Microsoft Defender for Mac / third-party AV | Mac | Free or paid | On-demand file scans on macOS |
Method 1: Right-click scan with Microsoft Defender (Windows)
Every modern Windows PC ships with Microsoft Defender built in, and it can scan a single file in seconds without opening any app. This is the method I use most.
- Locate the file (or folder) in File Explorer.
- Right-click it. On Windows 11 you may need to click Show more options to reveal the full menu.
- Choose Scan with Microsoft Defender.
- Defender scans the item and shows the results in the Windows Security window, telling you whether it found any threats.
If Defender flags something, follow its prompt to quarantine or remove the file, and do not open it. If it comes back clean but you are still uneasy, move on to VirusTotal for a broader look.
Run a deeper Defender scan
For a whole-system check, open Windows Security, go to Virus & threat protection, and choose Scan options. There you can run a Full scan of the entire PC or an Offline scan, which reboots and scans before Windows fully loads to catch stubborn malware that hides during normal operation.
Method 2: Upload to VirusTotal (any device)
Sometimes one antivirus is not enough reassurance. VirusTotal is a free service that analyzes a file against dozens of antivirus engines at once, so instead of one opinion you get a broad consensus.
- Go to the VirusTotal website in your browser.
- Choose the option to upload a file and select the file you want checked.
- Wait a few seconds for the results. You will see how many engines flagged it and what each detected.
On Windows there is an even faster route: after installing VirusTotal’s desktop helper, you can right-click a file and send it straight to VirusTotal. On a Mac, you can control-click the file, choose Open With, and select the VirusTotal Uploader, or drag the file into the uploader app.
How to read the results: a handful of engines disagreeing is common and often a harmless false positive, especially for niche or newly released software. But if several well-known engines flag the file as malicious, treat it as dangerous and delete it. One critical privacy note: anything you upload to VirusTotal may be shared with security researchers, so never upload files containing sensitive personal or confidential information.
Method 3: Scanning files on a Mac
Macs are not immune to malware, but Apple builds several protections into macOS that work quietly in the background.
- Gatekeeper checks that apps you open come from identified developers and warns you before running software from unknown sources.
- XProtect is Apple’s built-in malware scanner, which automatically checks files against known-threat signatures that Apple updates behind the scenes.
These run automatically, but they are not an on-demand “scan this one file” tool. For that, you have two good options. Microsoft Defender is available for Mac and can perform on-demand scans, and reputable third-party antivirus apps offer the same. Alternatively, use the VirusTotal Uploader described above to check an individual file against many engines. For most Mac users, keeping macOS updated so XProtect stays current, plus an occasional VirusTotal check on anything suspicious, is plenty.
Smart habits that beat any scanner
Scanning is a safety net, not a substitute for caution. These habits prevent most infections in the first place.
- Only download from trusted sources such as official websites and app stores.
- Be wary of email attachments, especially unexpected ones, even from people you know.
- Watch the file extension. A “document” that is actually an .exe or a script deserves extra suspicion.
- Keep your OS and antivirus updated, so signature databases stay current.
- When in doubt, do not open it. Scan first, and if results are mixed, delete it.
Frequently asked questions
How do I quickly scan one file for viruses on Windows?
Right-click the file in File Explorer, select Show more options if needed, and choose Scan with Microsoft Defender. It checks that single file in seconds and reports any threats in the Windows Security window.
Is VirusTotal safe and free to use?
Yes, VirusTotal is a free, widely trusted service that scans files against many antivirus engines at once. Just remember that uploaded files may be shared with security researchers, so never upload documents containing sensitive personal information.
Do Macs need to scan for malware?
Macs have strong built-in protections in Gatekeeper and XProtect, but they are not immune to malware. For on-demand scans of a specific file, use Microsoft Defender for Mac, a reputable third-party app, or the VirusTotal Uploader.
What should I do if a scan finds malware?
Do not open the file. Let your antivirus quarantine or delete it, then run a full system scan to be sure nothing else was affected. If it slipped through and you already ran it, disconnect from the internet and run a full or offline scan immediately.
What if different scanners disagree about a file?
A couple of engines flagging a file while most call it clean is often a false positive, common with niche or brand-new software. But if several reputable engines report it as malicious, treat the file as dangerous and delete it.
Can I scan a file before downloading it?
You can paste a download link into VirusTotal’s URL scanner to check the web address, and many browsers and security tools warn about known-malicious downloads automatically. For the file itself, download it and scan it before opening.
The bottom line
Learning how to scan a file for malware takes about a minute and is one of the highest-value security habits you can build. On Windows, the right-click Scan with Microsoft Defender option handles most checks instantly, and VirusTotal gives you a powerful free second opinion across many engines. Mac users are covered by Gatekeeper and XProtect for automatic protection, with Defender for Mac or VirusTotal available when you want to check a specific file. Pair these tools with cautious downloading habits, and you will sidestep the vast majority of threats.

