Legality means that an action or law must follow the rules set by the written law, not just what seems fair or reasonable.
In a court case, 'legality' is a core issue when one side argues that the other side's conduct or a government action violates an existing statute or constitutional principle. It appears when a defendant challenges whether the law itself is valid or whether the government had the legal authority to act. The court examines whether the challenged action falls within the boundaries of what the law permits.
If the court finds a lack of legality, the entire case or the government's action can be dismissed or invalidated, regardless of the facts. This means a person may win without ever arguing about what actually happened, simply by showing that the law was not properly followed.
People often confuse 'legality' with 'morality'—that something that feels wrong must be illegal, or that a legal technicality means the system is unfair. In court, legality is strictly about what the written law says, not about whether the outcome is just.
Get the actual rule
This page explains the concept. When it matters to your case, read the rule that governs it in your court — we hold Texas, federal and Washington court rules word for word, and every state's official resources are on the state pages. If someone cites a case at you, check that it exists first.
Related
General explanation, not legal advice, and not specific to any state — procedures and deadlines vary by jurisdiction and court. If you can get a lawyer or free legal aid, do: every real option.