UCMJ refers to the US Uniform Code of Military Justice. This legislation regulates offenses against military law in the US Armed Forces, from minor crimes committed by individuals to war crimes committed by senior military commanders. It covers diverse areas, including courts-martial, the apprehension and treatment of prisoners (both foreign and domestic), and the trial process for military tribunals.

The UCMJ applies to all active-duty reservists, national guards, and retired personnel. Originally intended to consolidate and revise all previous military justice systems, the UCMJ applies to all active-duty, reservist, national guard, and retired military personnel. The UCMJ underwent a significant change in 2016. One of the changes was to expand the crimes that an army court-martial could try. The UCMJ's
purpose was to consolidate and revise all previous military justice systems into one cohesive system.

However, a few parts of martial law remain under the jurisdiction of different bodies of law.

Sometimes nations need to remove other nation-states from the face of the earth. This usually involves military intervention, which is not a decision to be taken lightly. The Laws of War ("Juris in Bello") are the laws of international armed conflicts.

The laws of war are rules that apply during armed conflict. These are divided into two main categories:
  • International Law, such as the Geneva Conventions, regulates the conduct of war involving two or more states.
  • International Customary Law is a practice common to states regarding the customs prevailing among civilized peoples. Many nations have written laws of war that govern military conflict, not of an international character that arises in the territory of a single state.

Combatants include militaries, police forces, and groups conducting an active resistance against a government. According to the Geneva Conventions, they must respect the laws of war. Non-combatants must avoid places where war is being fought. However, they have the right to humanitarian assistance such as food, shelter, and medical care.

The principle of proportionality states that the force that may be lawfully used in self-defense must be "necessary and proportional" in response to an attack. In other words, the amount of force used in self-defense must be reasonable and rationally related to the harm it seeks to prevent.