The Metaphysics of Morals by Immanuel Kant Chapter 2 Page 90

We can now end where we started at the beginning, namely, with the conception of a will unconditionally good. That will is absolutely good which cannot be evil- in other words, whose maxim, if made a universal law, could never contradict itself. This principle, then, is its supreme law: “Act always on such a maxim as thou canst at the same time will to be a universal law”; this is the sole condition under which a will can never contradict itself; and such an imperative is categorical. Since the validity of the will as a universal law for possible actions is analogous to the universal connexion of the existence of things by general laws, which is the formal notion of nature in general, the categorical imperative can also be expressed thus: Act on maxims which can at the same time have for their object themselves as universal laws of nature.