
What Is the EICAR Test File? How to Use It to Safely Test Your Antivirus
How do you know your antivirus actually works? Not because the icon is in the system tray, and not because it has not complained lately — but because it has been tested against something it should detect. Testing with real malware is dangerous and irresponsible, and testing with a harmless-looking text file proves nothing. That gap is exactly what the EICAR test file fills: a harmless, standard, 68-byte string that every reputable antivirus product is designed to detect, so you can prove your protection is working without ever touching real malware.
This guide explains what the EICAR test file is, why it is safe, the exact test string, how to create and use it on Windows, macOS and Linux, how to interpret the result, and what it does — and does not — prove about your security.
What Is the EICAR Test File?
The EICAR test file is a standard test file developed by the European Institute for Computer Antivirus Research (EICAR) together with the Computer Antivirus Research Organization (CARO). It is not a virus. It is a short text string — 68 printable ASCII characters — that antivirus vendors agreed to treat as if it were a virus, so that anyone can test whether their antivirus is installed, switched on and working, without using real malware.
Because the string is part of a public standard, almost every antivirus product on the market detects it. When your antivirus flags the EICAR file, it is not saying “this is a virus” in the literal sense; it is saying “I am working, my signatures are loaded, and I can detect and handle the file you asked me to check.” That is the entire point.
The string is harmless by design. It contains no code that can run, it cannot infect a computer, it cannot spread and it cannot damage files. It is simply a pattern that antivirus engines look for. If you open it in a text editor, all you will see is a line of characters and the words “EICAR-STANDARD-ANTIVIRUS-TEST-FILE”. It is one of the safest files on the internet — and deliberately so.
The EICAR Test String
Here is the complete test string. Copy it exactly, with no extra spaces, line breaks or characters added before or after it:
X5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*
That is the entire file: one line, 68 characters. Save the string on its own in a plain text file, and antivirus products will know it as EICAR-Test-File (the exact detection name varies by vendor — for example, “EICAR-Test-Signature”, “EICAR-Test-File” or similar).
There are also standard variants for testing different situations, which you may come across in the official documentation:
- EICAR.COM: the string alone, saved as a file with a .com extension.
- EICAR.ZIP / EICAR2.ZIP: the file inside one, or two nested, ZIP archives — used to test whether an antivirus scans inside compressed files.
- EICAR.COM in a ZIP, renamed: variants that test whether an antivirus detects the string regardless of the file name or container.
For a basic test, the plain EICAR file is all you need. The archive variants are useful if you want to check that your protection scans inside files that arrive by download or by email — which is how malware often arrives.
How the EICAR Test File Works
Antivirus products work largely by recognition: they keep a database of known patterns — signatures — and check each file against it. Because the EICAR string is published as a standard, vendors add its exact pattern to their signature databases. When their engine scans a file and sees that pattern, it triggers its malware handling: quarantine, delete, block, or — most commonly — a pop-up alert saying a threat was found.
That tells you several things at once: the antivirus is installed, its real-time protection is turned on, its signatures are up to date enough to include the standard, and its response handling works. If any of those were broken, nothing would happen when you create the file.
There are limits to pay attention to, and they matter: the EICAR test only tests signature-based detection of a known pattern. It does not test whether the product can detect new, unknown malware, whether its behavioural engine is working, or whether it can stop ransomware, phishing or network attacks. It is a smoke test, not a full security audit — like testing a smoke alarm, it proves the alarm can sound, not that it can survive a fire.
How to Use the EICAR Test File on Windows
Follow these steps exactly, and expect your antivirus to react — that is the result you want.
- Close other work first: you are about to trigger an antivirus alert on purpose. Save any open documents.
- Open Notepad (or any plain-text editor — not Word, which adds formatting).
- Paste the test string exactly as printed above, on a single line, with nothing before or after it.
- Save the file as
eicar.comon your Desktop. Choose “All Files” as the file type in Notepad, so Windows does not add a .txt extension. - Watch your antivirus. On most systems with real-time protection enabled, the antivirus will detect and quarantine the file the moment it is saved — often before you even finish typing the file name. A pop-up will appear saying a threat was detected.
- Check the antivirus history or quarantine: you should see an entry for the EICAR test file, which confirms the detection was logged, not just displayed.
If the alert appears, your antivirus is working. If the file simply sits on your Desktop doing nothing, something is wrong — see the troubleshooting section below.
Do not be alarmed by the word “quarantine”. The file is harmless, and the quarantine entry will name it clearly as an EICAR test file. You can delete it from the quarantine when you are finished.
How to Use the EICAR Test File on macOS and Linux
The principle is the same on other platforms, and the commands are short:
- macOS: use TextEdit in plain-text mode, or the Terminal:
echo 'X5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*' > ~/Desktop/eicar.com— note that the string must be what is saved, exactly as printed above. Your Mac antivirus (if one is installed) should detect it; macOS’s built-in protections alone may not scan for this signature, because they are designed for macOS malware, not for testing signatures. - Linux: from a terminal, create the file with a text editor or the
echocommand as above, and test it with an installed scanner such as ClamAV by runningclamscan eicar.com. ClamAV should report the file as “Eicar-Test-Signature”. - By download: the official
eicar.orgwebsite — the organisation behind the test file — offers the standard file for download, including archive variants for testing whether your browser or email security blocks the download. If you use this route, download only from the official eicar.org site.
On any platform, do not create the test file on a computer that is not yours without permission, and do not send it by email to someone without warning them — email systems often block it, and a colleague receiving an unexplained “virus detected” alert will not thank you.
What the Results Mean
The result of an EICAR test has only two real outcomes, and both are useful.
- The antivirus detected it: your protection is on, its signatures are working and its response handling works. This is a pass. It does not prove you are invulnerable — it proves the basic mechanism works, which is exactly what you were testing.
- The antivirus did not detect it: something is wrong, or something is in the way. Real-time protection may be off, the product may not be installed correctly, its signatures may be out of date, or the file may not have been created exactly as the standard requires — an extra space or line break will change the string and the test will fail. Check those, and run the test again.
What if the file was detected before you even saw it, and you cannot find it? That is also a pass. Many products quarantine the file at the moment it is written, so quickly that the file never visibly appears on the Desktop. Check the product’s quarantine or history to confirm.
What the EICAR Test File Does Not Test
This is the part most guides skip, and the reason a pass can give false confidence if it is misunderstood. An EICAR pass does not test:
- New or unknown malware: the string is known to every vendor. A product can pass EICAR and still miss a zero-day or a new variant. Real protection also depends on behavioural analysis, machine learning and cloud intelligence.
- Ransomware and fileless attacks: attacks that encrypt your files or run only in memory do not look like a known test string.
- Phishing and social engineering: no antivirus test string stops a user from entering a password on a fake site.
- Your firewall, your patching or your configuration: the test checks one layer of defence. A firewall left wide open, or an unpatched system, remains a risk even with a working antivirus. Good defence is layered — antivirus plus patches, plus least privilege, plus multi-factor authentication, plus backups — and you can read our full guide on how to prevent viruses and malicious code for the rest of that checklist.
EICAR is also not a product comparison test. Two products can both detect EICAR instantly and still differ enormously in how well they detect real, current threats. Independent testing organisations that run hundreds of real-world samples are the proper way to compare products; EICAR is a quick check that yours is functioning, not a league table.
Troubleshooting: When the Test Does Not Work
If the file was not detected, work through these in order:
- Check the string is exact: the most common failure. The string must be one line, 68 characters, with no trailing space, no line break inside it and no characters missing. Copy it again from the official source and try a fresh file.
- Check the file extension: if you saved it as
eicar.com.txt, some products treat it differently. Make sure the file name is exactlyeicar.com, with no hidden .txt. - Check real-time protection is on: open your antivirus and confirm real-time or on-access scanning is enabled. Check your subscription is active — some products disable real-time protection when the licence lapses.
- Update signatures: run a manual update, then try again.
- Check your browser: if you downloaded the file, the browser’s own security or another layer may have removed it before your antivirus saw it. Try creating it with Notepad instead.
- It disappears instantly: this is usually a pass, not a failure — check the quarantine and the detection history before concluding otherwise.
If it is still not detected, treat that as a genuine finding. Consider reinstalling or replacing the product, and do not assume you are protected because you have not seen an alert.
Using EICAR in a Business or IT Team
For IT staff, EICAR is the safe way to answer a very common question: is the antivirus working on this machine, and on all of them? It can be used after a new installation, after a major update, during onboarding, after a security incident (to prove protection is back), or as a regular spot check. Because the file is harmless and standard, it can be deployed to many machines at once, and the detection results can be collected centrally.
In a business setting, follow these rules: schedule the test in advance, inform colleagues (so nobody mistakes a planned detection for a real incident), have a formal way to record the result for each machine, and never use a real malware sample “just to be sure”. No responsible security practice involves introducing real malware, and it will rightly alarm incident response teams, break compliance and, in the worst case, infect a network.
Safety Rules for Using the EICAR Test File
- Never use real malware to test security. The EICAR test exists precisely so that you do not have to.
- Do not disable your antivirus to make the file “work” — if it is only detected with protection off for long enough to create it, that is a finding, not a problem to work around (although some technicians briefly pause real-time protection to create the file and then scan it manually).
- Use only the official string from
eicar.orgor a reputable source. Do not accept a “test file” from an unknown attachment. - Do not email the file without warning and consent, and expect email gateways and mail services to block it.
- Delete it afterwards from quarantine where relevant, and keep a note of what you tested, when and with what result.
Frequently Asked Questions
Is the EICAR test file a virus?
No. It is a harmless, 68-character text string developed by EICAR and CARO as a standard. It contains no code that can run, cannot infect a computer, and cannot spread. Antivirus products are programmed to detect it on purpose, so that you can test them safely.
Is the EICAR test file safe to use?
Yes. It is safe by design and is used by antivirus vendors, IT teams and security professionals around the world. The only risk is confusion: someone who sees a “threat detected” alert without knowing a test is running can reasonably worry, so tell people in advance and only use it on your own systems or with permission.
Why did my antivirus not detect EICAR?
The most common causes are a copied string that is not exact (an extra space or line break), a wrong file extension, real-time protection being off, or signatures being out of date. If the file disappeared immediately, check the quarantine — fast detection is also a pass. If it is genuinely not detected, reinstall or update your protection and test again.
Can EICAR test ransomware protection?
No. EICAR tests whether your antivirus can detect a known test pattern — it does not simulate ransomware, fileless attacks or phishing, and a pass does not mean you are protected against them. Ransomware defence needs backups, patching, least privilege and behavioural protections as well.
Where can I download the EICAR test file?
From the official EICAR website, eicar.org, which offers the standard file and its ZIP variants. Creating the file yourself by copying the string into Notepad and saving it as eicar.com is equally valid and is often the simplest test.
Conclusion
The EICAR test file is a small, free and safe way to answer a question every computer user should ask: is my antivirus actually working? Create the file, watch for the detection, check that it was handled, and you have proved the basic mechanism works. If it is not detected, you have found a problem while it is still cheap to fix. Just remember what the test is — a smoke test for one layer of your security, not a guarantee of safety — and keep that layer combined with patches, careful browsing, multi-factor authentication, backups and the rest of good security hygiene. A working antivirus is the beginning of protection, not the end of it.


