Formally, a unique factorization domain is defined to be an integral domain *R* in which every non-zero non-unit *x* of *R* can be written as a product of irreducible elements of *R*:

*x*=*p*_{1}*p*_{2}...*p*_{n}

*x*=*q*_{1}*q*_{2}...*q*_{m},

The uniqueness part is sometimes hard to verify, which is why the following equivalent definition is useful: a unique factorization domain is an integral domain *R* in which every non-zero non-unit can be written as a product of prime elements of *R*.

All principal ideal domains are UFD's; this includes the integers, all fields, all polynomial rings *K*[*X*] where *K* is a field, and the Gaussian integers **Z**[*i*].

In general, if *R* is a UFD, then so is the polynomial ring *R*[*X*]. By induction, we therefore see that the polynomial rings **Z**[*X*_{1},...,*X*_{n}] as well as *K*[*X*_{1},...,*X*_{n}] (*K* a field) are UFD's.

The formal power series ring *K*[[*X*_{1},...,*X*_{n}]] over a field *K* is also a unique factorization domain.

The ring of functions in *n* complex variables holomorphic at the origin is a UFD.

Here is an example of an integral domain which is not a UFD: the ring of all complex numbers of the form *a* + *b* √ -5, where *a* and *b* are integers.

In UFD's, every irreducible element is prime. (Generally, in any integral domain, every prime element is irreducible.)

Any two (or finitely many) elements of a UFD have a greatest common divisor and a least common multiple. Here, a greatest common divisor of *a* and *b* is an element *d* which divides both *a* and *b*, and such that every other common divisor of *a* and *b* divides *d*. All greatest common divisors of *a* and *b* are associated.