A law is a universal principle that describes the fundamental nature of something, the universal properties and the relationships between things, or a description that purports to explain these principles and relationships.
Further information: Physical law
For example, physical laws such as the law of gravity or scientific laws attempt to describe the fundamental nature of the universe itself. Laws of mathematics and logic describe the nature of rational thought and inference (Kant's transcendental idealism, and differently G. Spencer-Brown's work Laws of Form, was precisely a determination of the a priori laws governing human thought before any interaction whatsoever with experience).
Within most fields of study, and in science in particular, the elevation of some principle of that field to the status of law usually takes place after a very long time during which the principle is used and tested and verified; though in some fields of study such laws are simply postulated as a foundation and assumed. Mathematical laws are somewhere in between: they are often arbitrary and unproven in themselves, but they are sometimes judged by how useful they are in making predictions about the real world. However, they ultimately rely on arbitrary axioms.
Finally, the term is sometimes applied to less rigorous ideas that may be interesting observations or relationships, practical or ethical guidelines (also called rules of thumb), and even humorous parodies of such laws.
Examples of scientific laws include Boyle's law of gases, conservation laws, Ohm's law, and others. Laws of other fields of study include Occam's razor as a principle of philosophy and Say's law in economics. Examples of observed phenomena often described as laws include the Titius-Bode law of planetary positions, Zipf's law of linguistics, Thomas Malthus's Principle of Population or Malthusian Growth Model, Moore's law of technological growth. Other laws are pragmatic and observational, such as the law of unintended consequences.
Some humorous parodies of such laws include adages such as Murphy's law and its many variants, and Godwin's Law of Internet conversations.