Proportionality (law)
Proportionality is a general principle in law which covers several separate (although related) concepts:

The concept of proportionality is used as a criterion of fairness and justice in statutory interpretation processes, especially in constitutional law, as a logical method intended to assist in discerning the correct balance between the restriction imposed by a corrective measure and the severity of the nature of the prohibited act.
Within criminal law, the concept is used to convey the idea that the punishment of an offender should fit the crime.
Under international humanitarian law governing the legal use of force in an armed conflict, proportionality and distinction are important factors in assessing military necessity.
Under the United Kingdom's Civil Procedure Rules, costs must be "proportionately and reasonably incurred", or "proportionate and reasonable in amount", if they are to form part of a court ruling on costs.

Proportionality as a general principle in law
History
A concept of proportionality that was testable in law was first developed in the High State Administrative Courts (German: Oberverwaltungsgericht) in Germany in the late 19th century, to review actions by the police.The proportionality test originated systematically with the jurisprudence of the Federal Constitutional Court, the Bundesverfassungsgericht.

European Union law
In European Union law there are generally acknowledged to be four stages to a proportionality test, namely,
there must be a legitimate aim for a measure
the measure must be suitable to achieve the aim (potentially with a requirement of evidence to show it will have that effect)
the measure must be necessary to achieve the aim, that there cannot be any less onerous way of doing it
the measure must be reasonable, considering the competing interests of different groups at handIt is, however, often seen that the third and fourth criteria are often merged into one by the European Court of Justice, depending on the margin of discretion that the Court sees as being afforded to the member state. Examples are found in R (Seymour-Smith) v Secretary of State for Employment, where the ECJ points out that a member state has some discretion in the policies it pursues, surrounding unfair dismissal, in reducing unemployment. Further examples of the proportionality test are seen in Mangold v Helm and Kücükdeveci v Swedex GmbH & Co KG.

European Convention on Human Rights
In the European Convention on Human Rights, proportionality is one of main principles utilised by the European Court of Human Rights used for scrutinizing actions adopted by national authorities which restricts rights under the Convention - the other is the margin of appreciation.

Australia
While the European Union has placed a consistent focus on the proportionality test in the context of policy issues, namely human rights, the proportionality test in the Australian context is a matter of constitutional interpretation with respect to legislative power under the Constitution. Unlike Europe, the proportionality test as a means to characterize whether Commonwealth legislation falls under a head of power under section 51 of the Constitution of Australia, has attracted divergent viewpoints, in which Kirby J has remarked that the 'test has not enjoyed universal favour'. However, Owen Dixon CJ made clear that 'the question is essentially one of connexion, not appropriateness of proportionality, and where a sufficient connexion is established, it is not for the Court to judge whether the law is inappropriate or disproportionate'.

Criminal law
In criminal law, the principle of proportional justice is used to describe the idea that the punishment of a certain crime should be in proportion to the severity of the crime itself. In practice, systems of law differ greatly on the application of this principle. The principle of guilt is an absolute standard from which the 17th century Bloody Code of England emerged, which specified the death penalty even for minor crimes. In the 18th century Cesare Beccaria published On Crimes and Punishments which was to form the basis of penology based on the relative standard of culpability. 
As a result Jeremy Bentham developed the idea of the panopticon in which prisoners would simply be watched, rather than subjected to corporal punishment. The idea in practice became a cruel and ineffective corrective. In some systems, proportionality was interpreted as lex talionis, (an eye for an eye). In others, it has led to a more restrictive manner of sentencing: for example, all European Union countries have accepted as a treaty obligation that no crime warrants the death penalty, whereas some other countries in the world do use it.
In self-defense cases, the amount of force employed by the defender must be proportionate to the threatened aggressive force. If deadly force is used to defend against non-deadly force, the harm inflicted by the actor (death or serious bodily harm) will be greater than the harm avoided (less than serious bodily harm). Even if deadly force is proportionate, its use must be necessary. Otherwise, unlawful conduct will only be justified when it involves the lesser harm of two harmful choices. If countering with non-deadly force or with no force at all avoids the threatened harm, defensive use of deadly force is no longer the lesser evil of only two choices. Alternatives involving still less societal harm are available.
In United States Law, the United States Supreme Court proposed the Proportionality Doctrine in three cases during the 1980s, namely Enmund v. Florida (1982), Solem v. Helm (1983) and Tison v. Arizona (1987), to clarify this key principle of proportionality within the Cruel and Unusual Punishment Clause of the Eighth Amendment. The fundamental principle behind proportionality is that the punishment should fit the crime. In 1983, the U.S. Supreme Court ruled that courts must do three things to decide whether a sentence is proportional to a specific crime:
Compare the nature and gravity of the offense and the harshness of the penalty,
Compare the sentences imposed on other criminals in the same jurisdiction; i.e., whether more serious crimes are subject to the same penalty or to less serious penalties, and
Compare the sentences imposed for commission of the same crime in other jurisdictions.Proportionality is also present in other areas of municipal law in the United States, such as civil procedure. For example, it is embodied in Fed.R.Civ.P. 26(b)(2)(C), which considers whether the burden or expense of the proposed discovery outweighs its likely benefit.  Proportionality is a key consideration in the discovery process, and has been applied to e-discovery, where it has been attributed with significant cost-savings. It is likely that proportionality will be applied to new and developing areas of law, such as the law of legal technology.

International humanitarian law
The harm caused to civilians or civilian property must be proportional and not "excessive in relation to the concrete and direct military advantage anticipated" by an attack on a military objective.Luis Moreno-Ocampo was the Chief Prosecutor at the International Criminal Court who investigated allegations of war crimes during the 2003 invasion of Iraq. He published an open letter containing his findings; in a section titled "Allegations concerning War Crimes", he elucidates this use of proportionality:

Under international humanitarian law and the Rome Statute, the death of civilians during an armed conflict, no matter how grave and regrettable, does not in itself constitute a war crime. International humanitarian law and the Rome Statute permit belligerents to carry out proportionate attacks against military objectives, even when it is known that some civilian deaths or injuries will occur. A crime occurs if there is an intentional attack directed against civilians (principle of distinction) (Article 8(2)(b)(i)) or an attack is launched on a military objective in the knowledge that the incidental civilian injuries would be clearly excessive in relation to the anticipated military advantage (principle of proportionality) (Article 8(2)(b)(iv)).
Article 8(2)(b)(iv) criminalizes:
Intentionally launching an attack in the knowledge that such attack will cause incidental loss of life or injury to civilians or damage to civilian objects or widespread, long-term and severe damage to the natural environment which would be clearly excessive in relation to the concrete and direct overall military advantage anticipated;
Article 8(2)(b)(iv) draws on the principles in Article 51(5)(b) of the 1977 Additional Protocol I to the 1949 Geneva Conventions, but restricts the criminal prohibition to cases that are "clearly" excessive. The application of Article 8(2)(b)(iv) requires, inter alia, an assessment of:
(a) the anticipated civilian damage or injury;
(b) the anticipated military advantage;
(c) and whether (a) was "clearly excessive" in relation to (b).

See also
Civilian casualty ratio
Convention on Cybercrime
Let the punishment fit the crime
R. v. Oakes [1986] 1 S.C.R. 103
Ryuichi Shimoda et al. v. The State
Strict scrutiny

Notes
References
Hirschberg, Lothar (1981), Der Grundsatz der Verhältnismäßigkeit, Schwarz
Moreno-Ocampo, Luis (February 9, 2006), OTP letter to senders re Iraq (PDF), International Criminal Court, archived from the original (PDF) on March 27, 2009
Shamash, Hamutal Esther (2005–2006), "How Much is Too Much? An Examination of the Principle of Jus in Bello Proportionality", Israel Defense Forces Law Review, 2, SSRN 908369
Luebbe-Wolff, Gertrude (2014), "The Principle of Proportionality in the Case-Law of the German Federal Constitutional Court", Human Rights Law Journal: 12–17
Billis, Emmanouil et al. (eds.) (2021), Proportionality in Crime Control and Criminal Justice, Hart Publishing {{citation}}: |first= has generic name (help)

External links
Engle, Eric Allen (2012), "The History of the General Principle of Proportionality", Dartmouth Law Journal, 10 (1): 1–11, SSRN 1431179
Hampson, Françoise (2011). "Military Necessity". Crimes of War Education Project. Archived from the original on June 7, 2013.