Hidden Power's type is determined by the IVs of a Pokemon. For example, if you have 31 IVs in Attack, Defense, Speed, and HP and 30 IVs in Special Attack and Special Defense, the Pokemon's Hidden Power type will be Ground. The only types that Hidden Power cannot be are Normal and Fairy.
If you need one, there is a Hidden Power IV list here.
Hope this helps!