We discuss some algebraic aspects of quantum permutation groups, working over arbitrary fields. If 𝕂 is any characteristic zero field, we show that there exists a universal cosemisimple Hopf algebra coacting on the diagonal algebra 𝕂n: this is a refinement of Wang's universality theorem for the (compact) quantum permutation group. We also prove a structural result for Hopf algebras having a non-ergodic coaction on the diagonal algebra 𝕂n, on which we determine the possible group gradings when 𝕂 is algebraically closed and has characteristic zero.