We introduce the notions of Hopf quasigroup and Hopf coquasigroup H generalising the classical notion of an inverse property quasigroup G expressed respectively as a quasigroup algebra kG and an algebraic quasigroup k[G]. We prove basic results as for Hopf algebras, such as anti(co)multiplicativity of the antipode S : H → H, that S = id if H is commutative or cocommutative, and a theory of crossed (co)products. We also introduce the notion of a Moufang Hopf (co)quasigroup and show that the coordinate algebras k[S n ] of the parallelizable spheres are algebraic quasigroups (commutative Hopf coquasigroups in our formulation) and Moufang. We make use of the description of composition algebras such as the octonions via a cochain F introduced in . We construct an example k[S]⋊Z 2 of a Hopf coquasigroup which is noncommutative and non-trivially Moufang. We use Hopf coquasigroup methods to study differential geometry on k[S] including a short algebraic proof that S is parallelizable. Looking at combinations of left and right invariant vector fields on k[S] we provide a new description of the structure constants of the Lie algebra g2 in terms of the structure constants F of the octonions. In the concluding section we give a new description of the q-deformation quantum group Cq [S] regarded trivially as a Moufang Hopf coquasigroup (trivially since it is in fact a Hopf algebra) but now in terms of F built up via the Cayley-Dickson process.