An IP address like this or

What's the last number mean in the IP address (24 or 16 in the above example)? Is there a simple way to understand how to set the number after the slash?


An IP address is just a number. One that - as I'm sure you know - uniquely identifies a computer on a network. But still just a number, which we will get back to.

Let's take an example:

You'll notice that the IP address is broken up into four parts: {192, 168, 1, 105}. And you probably also know that each of those parts can have a value from 0-255.

It turns out that the numbers 0..255 can be represented in 8 bits. So an IP address consists of four sections, and each section can have a value 0..255. This means that each section can be represented with 8 bits. With four of these sections, you have (4 sections) * (8 bits/section) = 32 bits. To represent the entire IP address.

Remember when we said that an IP address is just a number? Well, an IP is a 32-bit integer. For convenience, we write it as "" but you could easily write it as 0xC0A80169

In binary, all 32 binary digits in their glory: 11000000101010000000000101101001

Okay. So now your question: what does mean?

It means that the first 24 bits of the IP address are the "subnet". It means that the first 24 bits of items on your network are the same. As you add new computers, you only have 8 bits remaining (remember, an IP is a 32-bit number) for addressing new devices.

Because you have 8 bits worth of addressability, in this example, you may only add 255 devices.

110000001010100000000001 01101001

Let's break apart the subnet:

11000000 10101000 00000001 = 192 168 1


Same example with a /16 subnet:

1100000010101000 0000000101101001

So in this case, every IP address begins with 192.168 - the first 16 bits of the IP address. And then we have 16 bits remaining for new devices. 16 bits = 65535 devices.

So if you have a small subnet, you have a larger portion of internet addresses. MIT owns a /8 subnet - that is, have a block IP addresses and they can add 2^24 devices. Very cool!

  • how do you get this," the numbers 0..255 can be represented in 8 bits?" thank you. Dec 10 '11 at 5:52
  • 4
    You've misused the term "subnet mask" here. Just "subnet" or "network (address)" should be used. The part after the slash is the subnet mask.
    – camh
    Dec 10 '11 at 6:08
  • @runeveryday If you open your calculator in binary/hex mode it'll be easier to see. Each bit can have 2 states. Every bit you add will double the number of states you can represent. With 8bits you can have 2^8 = 256 states, thus 0-255.
    – greatwolf
    Dec 10 '11 at 8:53
  • what camh said, and when you use subnet masks in other contexts (e.g., in any network configuration settings) has a subnet mask of, what you're speaking of is definitely the network address.
    – derobert
    Dec 10 '11 at 13:31

Those aren't ip addresses per se, they are ranges. The last number (which, as psusi mentions is called a subnet mask) indicates the number of relevant bits: /16 means the network includes all numbers starting with the first 16 bits of the specified ip (223.248 in your example). A /8 is a class A network with 2^24 addresses, /16 is class B with 2^16 (65536), and a /24 is a class C with 2^8 = 256 addresses. You most often see this in local networks: (usually used in small home networks) and, usually seen in larger company intranets. You can see other reserved ranges listed in subnet notation and a range list, and the total number of doamins on Wikipedia.

  • 6
    It's also important to note that numbers besides 8, 16, and 24 are allowed. is perfectly valid, and means–
    – derobert
    Dec 10 '11 at 4:35

It is the subnet mask for the network. In other words, it says how large the network is. A /24 is a class C network, having 256 addresses and a subnet mask of A /16 is class B, with a subnet mask of

  • how many addresses A /16 are having? how to get 24 or 16? are there still other numbers Dec 10 '11 at 3:47
  • 2
    /24 isn't class C, nor is /16 class B, nor /8 class A. Those classes are all specific ranges of IP addresses, a class C comes from– So is not class C, it's actually a subnetwork in class A space. Its best to avoid using the old classfull terminology.
    – derobert
    Dec 10 '11 at 4:30
  • @derobert, a possible technicality, though you very well can write and it really is a class C.
    – psusi
    Dec 11 '11 at 3:06
  • @runeveryday, a /16 has 16 bits for the network and 16 for the host address, giving 2^16, or 65536 addresses. A /24 uses 24 bits for the network leaving 8 for the host, giving 2^8 or 256 addresses. You can use any value after the / between 1 and 31.
    – psusi
    Dec 11 '11 at 3:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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