FactorInteger

FactorInteger[n]
returns the factorization of n as a list of factors and exponents.

To get back the original number:

FactorInteger factors rationals using negative exponents: