15th of Aug. 2026 by Michael

Tech-Blog

Invalid vs. Illegal

Every so often i come across the word “illegal” in a computer science context: illegal numbers, illegal statements, and – remember those? – the infamous “Illegal Instruction” errors we were getting from Windows, referring to an Intel or AMD processor fault.

If this makes you smile because you see what’s coming, see this old clip by Three Trolls in a Baggie where there’s a cameo of this concept.

The thing is, these instructions are not illegal – no swat team will come shouldering in when you provoke this error on your PC. And the CPU maker will not be sued for putting the instruction into their processor.

Illegal in this context is an awkward choice of words for saying “not allowed” in the context where the instruction was found in - perhaps due a hacking attempt, which further compounds the mistake.

The hacking attempt would be illegal, not the instruction, in all likelyhood
 but imagine, if the exploit could damage computers, or the case sufficiently egregious, the lawmakers could indeed proceed to making the very instruction illegal in the aftermath. Okay, that’s admittedly far fetched and hasn’t ever happened, but still.

The technical term for “not accepted” or not formally working is “invalid”. For example if a website states that your password must not include numbers, then “p4ssword” will probably be rejected as invalid, rather than illegal. But “+UrPresidentX=1Goatsucker” may in some countries be considered illegal, I guess.

This distinction can actually feel a bit chilling (like: “do you really mean this?”), once you are conscious of the distinction between these two words.

For example, there were times in the US and in France in the 90ies (Crypto Wars), when a strong encryption key could have been valid for your software and perfectly working, but illegal to use with your software (by law in those days). So the distinction between these two concepts is definitely not academic.

Invalid means: not allowed in a formal/syntactic context, and illegal means: not allowed by law.

Validity is inherent to a given formal system. Legality is a completely orthogonal concept.