Definition: In mathematics, a canonical form of a mathematical entity is a well-defined one-to-one mapping on the set of entities to a unique representative of each equivalence class of an equivalence relation.

The definition notably contains a plethora of indefinite articles. There is no unique canonical form, although there is typically one which meets the subjective definition of "simplest". Specification of a particular canonical form is required before the idea can become a thing.

For example, the set of rational numbers p/q for integers p and non-zero q has the canonical form (relative to the usual equivalence relation, equality), given by the reduction of the rational number to lowest terms, by removing the highest common factor of p and q. Note that this alone is not sufficient to ensure the canonical form is well-defined. Applying this algorithm to 2/4 and (-2)/(-4) does not give identical results, although the two are equal. It is sufficient to ensure q is positive to complete the definition of this canonical form. Furthermore, note that a canonical form is not necessarily an invariant. The sum of two rational numbers a/b and c/d, (ad+bc)/cd is not necessarily in the canonical form, even if the source operands were, such as 1/3+1/6 = 9/18 = 1/2.

Once a canonical form is defined, their usefulness stems from the observation that any two entities are equivalent if their canonical forms are identical. Typically, if objects are reduced to a particular canonical form, operations on and comparisons of those objects are far simpler, a principle that extends outside of mathematics. It is much easier to work with measurements that are in a consistent set of units, and failure to do so may result in disaster. Case sensitivity in computing is an area where canonicalization can ensure names, such as uniform resource identifiers, refer to the same entity even though the binary representation of the two names may differ. Technologies such as Unicode can make canonicalization highly nontrivial, but it is essential before operations such as comparison can effectively be used. Incorrect canonicalization can lead to undesirable results.