The easy way
If you're playing any game Platinum or later, there is a Hidden Power type checker NPC somewhere in your game. They will reveal the Hidden Power type of your Pokemon for free.
- Pt: Veilstone City, in the Game Corner prize house
- HGSS: Celadon City, in the Game Corner
- BW: Mistralton City, in the Pokemon Center
- B2W2: PWT, from the man in the booth next to the main building
- XY: Anistar City, in the house next to the botique
- ORAS: Fortree City, in the second house in the canopy from the west
- SM, USUM: Paniola Ranch, in the nursery
If you're playing a different game, you can teach Hidden Power to your Pokemon without saving and test it against wild Pokemon to infer the type.
The harder way
Hidden Power's type depends on your Pokemon's IVs, which are random numbers your Pokemon has assigned to each of its stats, between 0 and 31. The IVs are put into this simple formula...
...where a, b, c, d, e and f mean the following (in layman's terms):
- a is 0 if the HP IV is even, and 1 if the HP IVs is odd.
- b is 0 if the Attack IV is even, and 1 if the Attack IV is odd.
- c is 0 if the Defence IV is even, and 1 if the Defence IV is odd.
- d is 0 if the Speed IV is even, and 1 if the Speed IV is odd.
- e is 0 if the Sp. Attack IV is even, and 1 if the Sp. Attack IV is odd.
- f is 0 if the Sp. Defence IV is even, and 1 if the Sp. Defence IV is odd.
The result of the calculation (after rounding down) will be a number from 0 to 15, so there are 16 possibilities. Since Hidden Power cannot be Normal-type or Fairy-type, there is a number for every possible type. They are bound as follows:
- 0 → Fighting
- 1 → Flying
- 2 → Poison
- 3 → Ground
- 4 → Rock
- 5 → Bug
- 6 → Ghost
- 7 → Steel
- 8 → Fire
- 9 → Water
- 10 → Grass
- 11 → Electric
- 12 → Psychic
- 13 → Ice
- 14 → Dragon
- 15 → Dark
This system has various consequences, such as certain Hidden Power types being statistically more common than others, and the "perfect" IV spread with 31 points in all stats being locked into Dark-type.
This answer is an abridged version of Bulbapedia's article on the subject, which you may care to read now that you've read a high-level overview. The article includes worked examples, differences in the Gen 2 games, and the (very similar) process for determining Hidden Power's base power.