The principle of legality implies the prohibition of analogy in criminal law. One of the most important principles of criminal law today is the principle of legality, the essence of which is: Nullum crimen, nulla poena sine praevia lege (there is no crime or punishment without privilege). In addition, the principle of legality includes a number of guarantees contained in criminal law. The principle of legality in criminal law was born and developed over time, where we observe precursors such as Beccaria`s work: “Crimes and Punishments”, based on the social contract of Rousseau and Montesquieu and the separation of powers. Also contained in various declarations of human rights and international covenants and also logically present in Spanish criminal law. They are also of great importance in the field of criminal law, non-retroactivity and the principle of territoriality. Its application in our legal system and the interpretation of the constitutional standard made by the TC understand that any criminal act requires the existence of a previous formal law prepared by Parliament and describing a certain assumption of fact.