You can check if a file or link has a virus before you download it and there are great free resources on the internet to do so. Nothing beats safe internet usage practices and smart browsing, though. 

I’m Aaron, an information security evangelist and lawyer with almost two decades of applied information security experience. I believe that the best defense against cyberattacks is a good education. 

Join me for a review of how to scan files for viruses before you download them and some of the features your computer likely has to protect you. I’m also going to cover some of the things you can do to stay safe when downloading files.

Key Takeaways

  • There are a number of tools you can use to check for viruses before you download them.
  • Virus scanning isn’t foolproof.
  • You should combine virus scanning with safe internet usage practices.

How to Check for Viruses?

All virus-scanning software operates effectively in the same way. The program looks for malicious code and other indicators of compromise in a file. 

If the program finds malicious content, it blocks or quarantines the file to prevent the malicious code from running on your computer. If it doesn’t find malicious content, then the program is free to run. 

There are a few online services that scan links and content for viruses. 


VirusTotal is probably the most prolific service for scanning files and links for viruses. It was started in 2004 and acquired by Google in 2012. It aggregates virus data from many sources and applies that information to an analysis of your files. 

You may be asking yourself: is VirusTotal safe? The answer is yes. VirusTotal scans your file and lets you know whether or not it’s detected a virus. The only thing it records is information about the virus to improve its database. It doesn’t copy or store the contents of the file you upload for review. 

Gmail and Google Drive

Google’s Gmail service has built-in virus scanning capabilities for attachments. Google Drive scans files at rest and when they’re downloaded. There are some limitations to those services, like file size limitations for scanning in Google Drive, but overall they provide a good defense against viruses. 

Microsoft Defender

Ok, this one technically doesn’t scan files for viruses before you download them. Rather, it scans the file as you download it. If you have Defender enabled on your computer, files you download will be scanned as they are downloaded or immediately upon download. Importantly, the files will be scanned before you open them, which is what triggers a virus to work. 

Scanning for Viruses is Only One Tool in Your Toolbelt

Just because a virus scanner doesn’t find a virus doesn’t mean that a file is virus free. Some viruses and malware can be expressed in a sophisticated way and are hidden from virus scanners. Others download malicious code when executed. Others yet may be zero day viruses, which means that definition files don’t yet exist to scan for them. 

As a result of those issues, around 2015 the antivirus software market began a shift away from only definition-based detection to adding behavioral detection. 

Definition-based detection is where an antimalware program uses code scanning to identify malicious content like malware and viruses. Behavioral detection is where an antimalware program examines what happens to your computer to identify malicious activity. 

VirusTotal and Google’s services are good examples of definition-based antimalware detection. Microsoft Defender is a great example of antimalware software that uses both definition-based and behavioral detection.

There’s an excellent set of YouTube videos about behavioral detection and heuristic detection, which was the precursor to modern behavioral detection. 

Neither set of software is foolproof. You shouldn’t rely on antimalware software alone. Safe internet use is critical to keeping yourself virus free. Some things you can do include:

  • Only download files if you know where they came from and trust the source.
  • Be careful when you visit disreputable or questionable sites.
  • Use an ad-blocker as viruses can be deployed via popup ads.
  • Know what a phishing email looks like and try to avoid clicking links in them.

The more you know about secure browsing practices, the safer and less virus prone you’ll be. 


Here are some common questions about checking files for viruses.

How Do I Know if I Downloaded a Virus on My Phone?

Fortunately, it’s highly unlikely you downloaded a virus on your phone. If you downloaded a pdf, for example, that runs a virus made for Windows when you open it then it won’t work on Android or iOS. Those are totally different operating systems. 

Additionally, the way iOS and Android operate makes traditional viruses ineffective. Most malicious code on those devices is delivered via apps. 

Can I Get a Virus from a File That I Downloaded but Didn’t Open?

No. You need to open the file to start the virus program or start the script that downloads and runs the virus. If you download a malicious file and it is not opened or run, then you’re likely safe.

Can I Check if a Zip File Has a Virus?

Yes. If you have anti-malware software on your computer, it’s likely that the software scanned the zip file on download. It’s also likely that the software will scan the zip file when it’s opened. 

You can also upload the zip file to VirusTotal or scan it manually. How you do that varies depending on the antimalware software you have and you should consult the manual or FAQ for that software to learn more. 

How Do I Know if I Downloaded a Virus?

You’ll know if your antimalware software tells you that you’ve downloaded a virus. Typically antimalware software lets you know when you have a virus and the files it quarantined so that you can review what to do with them. 

If you don’t see a warning, you may still have a virus. Look for significant performance impacts and slowdowns when you use your computer, or atypical behavior when you use your computer. 


There are numerous ways to scan a file for viruses both before and after you download it. Your best bet, though, is to practice safe internet browsing habits. Virus scanners can be fickle and your instincts can go a long way to keeping you safe online if you know what to look out for.

What safe browsing practices would you recommend? Let your fellow readers know in the comments–we’ll all be safer for it!