We prove that both, the embedding of the category of Hopf algebras into that of bialgebras and the forgetful functor from the category of Hopf algebras to the category of algebras, have right adjoints; in other words: every bialgebra has a Hopf coreflection and on every algebra there exists a cofree Hopf algebra. In this way we give an affirmative answer to a forty years old problem posed by Sweedler. On the route the coequalizers and the coproducts in the category of Hopf algebras are explicitly described. 2000 Mathematics Subject Classification. 18A30, 18A40. Key words and phrases. bialgebra, Hopf algebra, (co)product, (co)limit, (co)complete, (co)refective. The author acknowledges partial support from CNCSIS grant 24/28.09.07 of PN II "Groups, quantum groups, corings and representation theory".