Total host by Subnets

I am trying to understand how many hosts can exist in a certain subnet based on the subnet mask provided. however it is a bit confusing when the subnet mask does not match the subnet class.
I am checking the table in this link:

I see:
 for class B network /25

  25 128 126 512 64512

Why total hosts is 64512 ?
I thought 126 is the correct number

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Mohammed KhawajaManager - Infrastructure:  Information TechnologyCommented:
Class B subnet mask is and further subnetting this will be which will yield 32766 hosts.  You could have IP address that may be part of a B class network but you could further subnet it as C class to give you larger subnets with small hosts (i.e. /25 which is for a total of 126 hosts).

/24 is the default C class network which can be subnetted further.  /16 is the default B class and /8 is the default A class.

You are correct, 126 is the total number of hosts available per subnet.  However, if you take a single Class B subnet and divide it into /25 subnets, you'll get 512  different /25 subnets, each capable of hosting 126 devices, giving you a total host capacity of 64512 for the entire Class B subnet.

In practice, you'll most often consider the per subnet-value - The total value will only be considered when planning for future expansion - reserving an entire Class B subnet to use as /25 subnets will provide you with a theoretical capacity of handling 64500 hosts, which could indicate if you're over or under provisioning for your expected demand.
64512 is the total number of hosts in all (512) possible /25 networks of a class B address range.

A single /25 subnet can contain 126 hosts, as you correctly assumed.

64512 = 512 * 126
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

jskfanAuthor Commented:
Let's make it simple: /24

this will give 24 to the power of 2 (24^2) Networks and (2^8)-2 =254 Hosts ( to

so the network will give 254 hosts, and the only way to get more than 254 hosts is either to create another subnet, example : or subnetting the existing network and make it /23

in this case ,what will be the first host and last host ?

  is the first will be192.168.1.1 and the last ?

Craig BeckCommented:
If you have a network of you can use addresses - inclusive.  The network is actually

Let's take your example: gives 254 hosts.  256 (number of addresses in subnet) - 2 (broadcast and network addresses) = Total usable hosts.

Now, let's break that up.  If we subnet that down to two /25 networks we get and  That gives us: - and - as usable addresses.  Do the maths...
256/2 = 128.  Subtract the two addresses (broadcast and network - we do this for EVERY subnet), that leaves 126.  Now we do that for the second /25 subnet.  So, instead of losing 2 addresses (broadcast and network address) we lose 4 here (2 per subnet).

Make sense?

In a /16 network we can use 65534 host addresses.  In a /17 network we can use 32766 addresses, but we can use two /17 in the same /16 space, so we have to take 2x broadcast and network addresses from the 65536 inside the /16, so we end up with 65532 host addresses; 32766 per /17.
jskfanAuthor Commented:
<<Now we do that for the second /25 subnet.>>

DO you mean  for subnet /25 we'll have usable addresses : - and -

I do not understand when you said we ll do that for second subnet, which one ?
What Craig explained, is actually the opposite what you asked - He took one subnet ( and divided that into two: Subnet 1 - (.1 - .126 usable) and Subnet 2 - (.129 - .254 usable).

You can do the reverse, i.e. merge two subnets to get more hosts.  So, to create a /23 subnet, the network address will be, with usable addresses from to

To understand why is not a network address, you'll have to look at the binary representation - "The TCP-IP Guide" have an extensive overview at
Craig BeckCommented:
DO you mean  for subnet /25 we'll have usable addresses : - and -

I do not understand when you said we ll do that for second subnet, which one ?
In my example I used a /24 network then split that into 2x /25 networks to explain how we end up with two less hosts per subnet.
jskfanAuthor Commented:
If I understand when you take a Network  address such as, you do not loose many hosts by breaking up that network into smaller subnets..
When you change the address mask, example  then you are borrowing one Bit from Network to Host..  the mask can be written as
 I do not think there will be any host that can be created on the third octet, since:
first subnet is, the second is, in this case is the broadcast will be the third subnet, etc..... the last will be
I don't see where the difference in hosts  between and
jskfanAuthor Commented:
oops  the mask can be written as
jskfanAuthor Commented:
I Guess where I am still confused, is how many usable hosts per subnet...

I was watching this video:
The instructor is saying  We ll have 62 hosts per subnet.

the address is
mask is

 why it is 62 per subnet... I know the last octet will give us 62 hosts, but the first three octet should not change (10.15.67)...
Craig BeckCommented:
I don't see where the difference in hosts  between and
The first issue here is that is not a valid network.  You can't use -  It has to be -, therefore the network is

If you take you have 254 hosts.  256 - 2 = 254.
If you take you have 510 hosts.  512 - 2 = 510.

However, if you take a /24 (just as an example) and subnet that into smaller blocks it changes depending on how you use it.  This is the same whenever you subnet a block into smaller chunks.

With a /24 we already know we can use 254 hosts.  If we split that into /25 networks we get two subnets - and  Remember, for EVERY subnet we need to subtract 2 from the subnet size to get the usable hosts, so where we had 254 hosts able to use a /24 we now have 126 hosts which are able to use each /25 network.  126 * 2 = 252 hosts, so you can see we lose 4 host addresses by subnetting in this way instead of 2.

Let's now split the /24 into /26 networks.  We get 4 subnets from the /24 by subnetting down to /26 -,, and  For each subnet here we get 64 - 2 = 62 hosts, so 62 (number of hosts) * 4 (number of subnets) = 248 usable hosts.

The thing to remember is that every subnet loses 2 hosts, regardless of the mask.  When you split a subnet you lose 2 hosts per subnet so where a /24 could accommodate 254 hosts once it's split it's no longer that size, so as per the example, 4x /26 networks can only accommodate 248 hosts.
jskfanAuthor Commented: =
number of subnets = 2^25=33554432 subnets
number of hosts= (2^7)-2=126

To my understand the IP addresses we can assign are  :       to:   to:

does the  3rd octets change too ?
for instance. these IP addresses we 'll be assigned too:  to : to :
======== to to

Till you reach: to to

jskfanAuthor Commented:
number if subnets=(2^23)8388608
number if hosts= (2^9)-2=512-2=510

the IP addresses that will be assigned: to = 254 Ip addresses to = 255 Ip addresses

254+255 Ip addresses is 509 IP addresses still not 510
Craig BeckCommented:
In the /23 network above, is the network address and is the broadcast address.  Why would you think that a /23 would have two broadcast and two network addresses?

You're missing something quite fundamental here (apart from your incorrect sum above).  You don't actually 'split' the /23 into two /24 networks when working out how many hosts you would have in a /23.  There is no precedent which says everything revolves around a /24; it's just the most common subnet size when referring to Class C networks.

Firstly, to is 254 addresses, not 255.

Secondly, a /23 is not the same as a /24.  A /23 address range lets you use the .255 and .0 in the middle of the range - they are valid host IP addresses.  Therefore the range spans across the following IP addresses: -

This includes and as usable host addresses.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
jskfanAuthor Commented:
I agree, I do not understand well Subnetting...
So when it comes to subnetting  or supernetting, does it apply to the following networks only :

for instance we cannot write /9, because the .168 will ne gone away ?
Also in your statement above :
<<A /23 address range lets you use the .255 and .0 in the middle of the range - they are valid host IP addresses.>>

I have not seen a Host with IP address of : OR
jskfanAuthor Commented:
I will do more reading about subnetting and come back...

Thank you

Thanks for the points and grades assigned, appreciated.

Just one last note - To understand IP addressing and the conventions, you have to look at the binary representation (or at least understand that the dotted-decimal notation we're used to is a representation of the binary address.)  Every explanation I've read that makes sense, and is universally applicable, starts from that foundation.  That's why I would strongly suggest the explanation provided by "The TCP/IP Guide", at - It moves a bit slow at first, but since it doesn't assume any prior knowledge of IP addressing, it is perfect to "fill in the gaps" other sources sometimes choose to ignore.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.