How to scan a file with your built-in antivirus

The fastest way to scan a single file is to use the antivirus software already on your computer. Windows comes with Windows Defender (called Microsoft Defender on newer versions), and macOS includes XProtect. Both let you scan one file without opening a full system scan, which saves time when you only want to check something suspicious.

On Windows, right-click the file you want to check. Select "Scan with Microsoft Defender" from the menu. The scan runs in the background and shows you a result window when it finishes — usually within seconds for a single file. If the file is clean, you'll see a green checkmark. If something is detected, Defender will tell you what it found and offer to remove it.

On macOS, the process is less direct because XProtect runs automatically in the background when you read or open files. If you want to manually scan a file, you can drag it into the Finder, right-click it, and select "Open" — this triggers XProtect to scan before the file opens. For a more thorough check, you can use the free Malwarebytes app, which works similarly to Windows Defender and gives you a scan-now button.

Key Takeaways

  • Windows Defender and Microsoft Defender (on newer Windows) let you right-click any file and choose "Scan with Microsoft Defender" without running a full system scan.
  • macOS XProtect scans files automatically when you read or open them, but you can also use the free Malwarebytes app for manual scans.
  • A single-file scan takes seconds to a few minutes depending on file size and your computer's speed.
  • If a virus is found, your antivirus will offer to quarantine or delete it — follow the program's recommendation unless you know the file is a false alarm.
  • For files from untrusted sources, scanning before opening is safer than scanning after, because some malware runs the moment you open it.

Using a web-based scanner for files you cannot open locally

If you want a second opinion or your antivirus is not working, you can upload a file to an online scanner without installing anything new. VirusTotal is the most widely used — it scans your file against 70+ antivirus engines at once and shows you which ones detect a threat.

Go to virustotal.com, click the upload box, and select your file. Wait for the scan to finish (usually under a minute). The results page shows a summary at the top: if most engines say the file is clean, it almost certainly is. If several flag it, treat it as unsafe. VirusTotal does not delete or modify your file — it only scans a copy you upload.

One important note: uploading a file to VirusTotal means sending it to their servers. If the file contains personal information or proprietary data, use your local antivirus instead. For everyday files from the internet, VirusTotal is safe and free.

Scanning files from email attachments and downloads

Email attachments are a common source of malware. Most email providers (Gmail, Outlook, Yahoo) scan attachments automatically before you read them, but you should still scan again on your computer before opening. Right-click the downloaded file and use your antivirus's scan option.

Files from read sites, torrents, or file-sharing services carry higher risk. Scan these before opening, even if they came from a source you trust. Malware can hide inside documents, installers, and compressed files (.zip, .rar) — your antivirus will detect it during the scan, before the file runs.

If you are unsure whether a file is safe, scanning costs nothing and takes less than a minute. It is always the right choice when you are in doubt.

What to do if a virus is detected

When your antivirus finds a threat, it will show you the file name and the threat name (for example, "Trojan.Generic" or "PUP.Optional.Unwanted"). Your antivirus will offer to quarantine, delete, or ignore the file. In almost all cases, you should choose quarantine or delete — these options remove the threat without harming your system.

Quarantine moves the file to a locked folder where it cannot run or spread. Delete removes it entirely. Either is safe. If you are certain the file is a false alarm (your antivirus sometimes flags legitimate software as suspicious), you can restore it from quarantine later, but this is rare.

After removing a threat, restart your computer. This clears any malware that may have already run before the scan caught it. If the same threat appears again on the next scan, your antivirus may not have fully removed it — in that case, consider running a full system scan or contacting a technician.

Understanding false alarms and low-risk detections

Antivirus software sometimes flags files that are not actually dangerous. This happens most often with legitimate software that uses techniques similar to malware, or with older programs that antivirus companies have not fully verified. These are called false positives.

If you downloaded a file from a trusted source (a major software company's official website, for example) and your antivirus flags it, you can usually trust the source over the warning. Check the threat name — if it says "PUP" (Potentially Unwanted Program) rather than "Trojan" or "Worm", the risk is lower. You can also search the threat name online to see whether other users have reported it as a false alarm.

That said, if you are not sure where a file came from or whether the source is legitimate, deleting it is the safest choice. There are millions of files on the internet — keeping one suspicious file is not worth the risk.

When to scan instead of just deleting a suspicious file

If a file looks suspicious but you want to know what it is before you delete it, scanning is the right move. Scanning tells you whether the file is actually dangerous without running it. This is especially useful for files with odd names, unexpected file types, or files that arrived unexpectedly in your email.

Never open a suspicious file just to see what it is — opening is how malware infects your computer. Scanning is safe because your antivirus examines the file's code without executing it. After the scan, you will know whether it is safe to open, safe to delete, or dangerous enough to quarantine.

Keeping your scanner up to date

Your antivirus is only as good as its virus definitions — the list of known threats it compares files against. Windows Defender and most other antivirus programs update automatically, usually daily. You do not need to do anything; the updates happen in the background.

Check your antivirus settings occasionally to make sure updates are turned on. In Windows Defender, open Settings, go to Privacy & Security, then Virus & Threat Protection, and look for "Manage settings." Make sure "Real-time protection" is on. On macOS, Malwarebytes updates automatically once installed.

If your antivirus is out of date, it may miss newer malware. Keeping it current takes no effort and is one of the most important things you can do to stay safe.

Frequently Asked Questions

Can I scan a file without antivirus software installed?

Yes. VirusTotal and similar online scanners work in any web browser without installing anything. Upload your file, wait for the results, and you will know whether it is safe. This works on any computer, including ones that do not have antivirus software.

Is it safe to scan a file if I think it might be ransomware?

Yes. Scanning does not run the file — it only reads the file's code. Ransomware cannot set up during a scan. Scanning is actually the safe way to check whether a file is ransomware before you open it.

What if my antivirus says the file is infected but I need to keep it?

If you trust the source and believe it is a false alarm, you can restore the file from quarantine. Right-click the quarantined file in your antivirus settings and select "Restore." However, only do this if you are confident the source is legitimate — restoring a truly infected file puts your computer at risk.

How long does it take to scan a single file?

Most single-file scans finish in seconds to a few minutes, depending on file size and your computer's speed. A 100 MB file might take 30 seconds; a 1 GB file might take a few minutes. Online scanners like VirusTotal usually finish in under a minute.

Do I need to scan files if I only read from official websites?

Official websites are much safer than random read sites, but scanning is still a good habit. Legitimate websites can be hacked, and malware can slip through even official sources. A quick scan takes less than a minute and gives you peace of mind.