What is the EICAR test file?

A harmless 68-character file that every antivirus engine agrees to flag, so you can prove your scanning works.

By Ihor Havrysh ยท Last reviewed July 2026

Eaglepedia mascot

The EICAR test file is a harmless 68-character text file that antivirus vendors have agreed to detect as though it were malware. It contains no viral code. It exists so you can confirm that a scanner is installed, reachable and reporting correctly, without handling real malware to do it.

What it actually is

The file is a single line of printable ASCII, published by the European Institute for Computer Antivirus Research in cooperation with the Computer Antivirus Research Organization. It was originally written by Paul Ducklin, refined in May 2003 by Eddy Willems with vendor input, and adapted again in September 2006.

Two properties make it useful. It is a valid DOS executable, so it is a real program rather than an inert string, and everything it does when run is print the line EICAR-STANDARD-ANTIVIRUS-TEST-FILE! to the console. And because it is made only of printable characters, you can type it, paste it or generate it in code without any special tooling.

Engines flag it because vendors deliberately added it to their signature sets, not because it poses any risk. That agreement is the whole point: it gives everyone a shared, safe trigger.

Using it to test an upload pipeline

If your application accepts files from users, the question worth answering is not whether you have integrated a scanner but whether that integration is actually live in the environment you are looking at. This is where EICAR earns its place, because a broken integration and a clean file look identical from the outside.

Microsoft documents the same technique for validating endpoint protection, and the principle carries over directly. Upload it exactly as a user would, through your own form or API, and check three things: that the file is rejected or quarantined, that the rejection is recorded somewhere you can see it, and that the caller receives whatever your contract says they should receive. Plenty of pipelines pass the first check and fail the third, returning a generic error that gives the user nothing to act on.

EICAR publishes four variants, and the differences between them are the interesting part:

  • eicar.com (68 bytes): the bare test file. Confirms the scanner is reachable at all
  • eicar.com.txt (68 bytes): the same content with a text extension. Confirms your pipeline inspects content rather than trusting the extension, which is the same principle behind checking magic bytes rather than file names
  • eicar_com.zip (184 bytes): the file inside an archive. Confirms your scanner opens archives
  • eicar_com2.zip (308 bytes): a ZIP within a ZIP. Confirms how many layers deep it is prepared to look
The four EICAR variants and the pipeline capability each one tests, from scanner reachability through to archive depth
Each variant asks a different question. The double-zipped one is where a pipeline configured for a single layer passes it straight through.

That last one is the test most pipelines quietly fail. A scanner configured to inspect one archive layer will pass the double-zipped file straight through, and you will not discover that until something real arrives packaged the same way.

What it proves, and what it does not

EICAR tests the plumbing. It confirms that a request reaches a scanner, that a verdict comes back and that your application does something sensible with it. Given how often a scanning step is quietly disabled in one environment and not another, that is genuinely worth confirming on every deployment.

What it cannot tell you is how your defences behave against something unfamiliar. It is one known signature that every engine has agreed to match, so it exercises the lookup path and nothing else. It says nothing about an unknown threat, a polyglot file that is valid as two formats at once, or a zip bomb that is perfectly benign until you decompress it.

Nor does it exercise sanitisation, which rebuilds a document from its safe components rather than matching it against known signatures: our guide to content disarm and reconstruction covers that distinction. And it will not tell you what happens when the scanner is unavailable, which is a separate and more consequential decision. Whether an upload is accepted or refused during an outage is a choice about failing open or failing closed, and it is worth making deliberately rather than discovering it during one.

Handling it safely

Your own machine will react to the file, which is the one practical annoyance. Endpoint protection normally quarantines it the moment it touches disk, so keeping a copy in a test fixtures folder tends not to survive contact with a real laptop.

Two approaches work well. Generate the 68-character string in memory inside the test itself, so nothing is ever written to disk, or keep test copies in a path your endpoint policy explicitly excludes. The first is cleaner and travels better through continuous integration.

EICAR is direct about the terms: you download the files at your own risk, and if one gets stuck in quarantine that is a conversation with your antivirus vendor rather than with EICAR. Nothing about the file is dangerous, but the tooling around it will treat it as though it were, which is exactly the behaviour you are testing for.

Testing the pipeline is the easy half. Deciding what should happen to a document that is suspicious rather than known-bad is the harder one. The Red Eagle Tech CDR API rebuilds documents from their safe components rather than waiting for a signature to match, so users get a working file back instead of an error. You can see what it does and be running in a few minutes, entirely self-service.

Frequently asked questions

No. It contains no viral code and cannot replicate, damage data or infect anything. It is a short, valid DOS program made entirely of printable ASCII characters, and all it does when run is print the line EICAR-STANDARD-ANTIVIRUS-TEST-FILE! Antivirus engines flag it because vendors agreed to add it to their signature sets on purpose, not because it is dangerous.

Because it is working. Your endpoint protection will normally quarantine the file the moment it lands on disk, which makes it awkward to keep a copy locally. The usual approach is to generate the 68-character string in memory at test time rather than storing it, or to hold test copies in a location your endpoint policy excludes. EICAR states plainly that you download these files at your own risk and that it cannot help you remove them - that is your antivirus vendor's job.

It means your scanning is connected and reporting. That is worth confirming, and it is a very common thing to get wrong, but it is a plumbing test rather than a security test. EICAR is a single known signature that every engine agrees to flag, so detecting it says nothing about how the scanner handles an unknown threat, a polyglot file or a structurally malformed document.

EICAR publishes the test string as a bare file, as a text file, inside a ZIP archive, and inside a ZIP within a ZIP. The nested versions are the useful ones for an upload pipeline, because they tell you whether your scanner opens archives at all and how many layers deep it is willing to look. A pipeline that catches the plain file but misses the double-zipped version has a real gap in it.

Partly. A sanitisation service will normally reject or strip it, so it confirms the integration is live. But content disarm and reconstruction works structurally, by rebuilding a file from its safe components rather than by matching signatures, so a signature test does not exercise the part that does the work. Testing that properly means sending real documents and checking what comes back out.
Ihor Havrysh - Software Engineer at Red Eagle Tech

About the author

Ihor Havrysh

Software Engineer

Software Engineer at Red Eagle Tech with expertise in cybersecurity, Power BI, and modern software architecture. I specialise in building secure, scalable solutions and helping businesses navigate complex technical challenges with practical, actionable insights.

Read more about Ihor

Discovery call

A friendly 15-minute video call with Kat to understand your needs. No preparation needed.

  • Discuss your project
  • Get honest advice
  • No obligation
Kat Korson, Founder of Red Eagle Tech

Kat Korson

Founder & Technical Director

Our team has 10+ years delivering software solutions for growing businesses across the UK.

Send us a message

Your information is secure. See our privacy policy.

Find us