Illegal means forbidden by a specific law, usually with a criminal penalty attached. Unlawful is broader — it covers anything not permitted by law, including acts that breach civil or contractual rules but are not crimes. Every illegal act is unlawful; not every unlawful act is illegal.
The core difference
In everyday use these are interchangeable. In legal writing they are not, and the difference is one of scope: illegal is a subset of unlawful.
How the scope differs
- illegal — prohibited by statute, typically with a criminal sanction: illegal parking, illegal possession of a firearm.
- unlawful — not permitted by law in any sense, including where no crime is committed: unlawful dismissal, unlawful interference with a contract.
An unlawful dismissal is a civil wrong. Nobody is prosecuted; the remedy is compensation. Calling it "illegal dismissal" overstates it.
Tone
Illegal is the blunter word and carries a criminal implication that unlawful does not. That is why careful legal writing reaches for unlawful where no offence is alleged — the choice is about accuracy, not delicacy.
In general writing
Outside a legal context the two are treated as synonyms and no reader will object. The distinction matters where the consequence does.