A firewall watches and controls the traffic coming into and out of a network, blocking unauthorised access before it gets in, while antivirus checks the files and programmes already on a device and removes or isolates anything harmful it finds. Picture the firewall as security on the front door and antivirus as the team that checks the rooms inside.
The core difference
A firewall guards the network boundary; antivirus checks for threats already on the device.
- firewall — software that monitors and controls network traffic to block unauthorised access: make sure your firewall is enabled before connecting to public Wi-Fi.
- antivirus — a programme that looks for harmful software on a device, warns about it, and removes or isolates what it finds: the antivirus quarantined the download before it could run.
How to tell them apart
The naming gives a strong clue: firewall comes from the fireproof barrier that stops fire spreading between parts of a building, so a computing firewall is a barrier that stops unwanted traffic spreading into a network. Antivirus is built from anti- plus virus, meaning it is aimed directly at software already present, scanning for known threats and suspicious behaviour rather than watching traffic at the border.
People often assume one covers the other, which is where mistakes creep in. A firewall can let a harmful file through if it arrives inside traffic that looks legitimate, since it is not designed to inspect file contents for malicious code. An antivirus, in turn, cannot stop an unauthorised connection attempt from reaching the network in the first place, since that is the firewall's job. Most security setups run both together for this reason, rather than treating either as a full replacement for the other.