Illegal means against the law. Illegal parking, it is illegal to, an illegal substance.
English has a set of near-synonyms with real differences. Illegal means forbidden by law. Unlawful is slightly broader and covers things not authorised by law even where no crime is committed. Illicit means forbidden or disapproved of, and is often about morals rather than statute. Illegitimate means not properly authorised. Note that illegal applied to a person — an illegal immigrant — is now widely avoided in careful writing, and undocumented or irregular is used instead.
1adjectiveillegalForbidden by law.
“It is illegal to park on the pavement.”
synonyms: unlawful, criminal, prohibited
2adjectiveagainstAgainst the rules of a game or organisation.
“The move is illegal and the referee missed it.”
Too few real examples of this word to estimate which sense is commonest.
illegal is a state of being forbidden.
Also accepted in games: unlawful
Latin legalis comes from lex, law — the same root as legislate, legitimate and loyal. The il- is a form of in-, not, assimilated before the l, which is the same rule that gives irregular, immoral and impossible.
Latin
legalis
Medieval Latin
illegalis
French
illégal
English, today
illegal
French illégal, from Medieval Latin illegalis, from Latin legalis, by surface analysis, il- + legal. In senses relating to immigration, via a clipping of illegal alien or illegal immigrant.
Etymology from Wiktionary, CC BY-SA