IP address classes are defined based on the number of bits used for the network and host portions of the address. There are five classes: A, B, C, D and E.
Class A addresses use the first eight bits for the network portion and the remaining 24 bits for the host portion. This allows for a maximum of 126 networks and 16,777,214 hosts per network.
Class B addresses use the first 16 bits for the network portion and the remaining 16 bits for the host portion. This allows for a maximum of 16,384 networks and 65,534 hosts per network.
Class C addresses use the first 24 bits for the network portion and the remaining 8 bits for the host portion. This allows for a maximum of 2,097,152 networks and 254 hosts per network.
Class D addresses are used for multicasting and have a fixed format of 1110 for the first four bits.
Class E addresses are reserved for experimental use and have a fixed format of 1111 for the first four bits.
The class of an IP address can be determined by examining the first few bits of the address.