This question already has an answer here:

my query is that what is the maximum no of host's are possible for Private network in class wise. i.e i want to know No of Private host's in CLASS A,B,C? how to calculate these no?

marked as duplicate by user36472, JFL, Ron Maupin Apr 19 '18 at 13:13

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 2
    Classfull networks are dead, killed by CIDR 25 years ago. Forget about them. – JFL Apr 19 '18 at 7:57

For classful networks, the available addresses are given by the Wikipedia page on Classful Networks.

Class A = 16,777,214

Class B = 65534

Class C = 254

The Wikipedia page also discusses the calculation:

The number of addresses usable for addressing specific hosts in each network is always 2N - 2, where N is the number of rest field bits, and the subtraction of 2 adjusts for the use of the all-bits-zero host portion for network address and the all-bits-one host portion as a broadcast address. Thus, for a Class C address with 8 bits available in the host field, the number of hosts is 254.

As Zac67 points out in the comments, /31 subnets differ in the calculation as there is no network and broadcast address. With /32 a single host is defined. These subnets are not available in classful networks but I'm adding them here for completeness.

It's worth noting that nobody uses classful networks anymore.

  • it's 2^n-2 for /0 to /30. /31 has no subnet and broadcast addresses, leaving 2 usable host addresses – Zac67 Apr 19 '18 at 11:20
  • @Zac67 You are correct; however, the question and the Wikipedia page talk about classful addressing in which /31 subnets are not possible. Classful addressing is useless and shouldn't be taught anywhere outside history lessons. – Patrick Mackey Apr 19 '18 at 19:54

Not the answer you're looking for? Browse other questions tagged or ask your own question.