system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5:What does "/16 or /24" after an IP Address mean?

Hello all - I have seen the /16, /24, etc multiple times after an IP Address and I just don't understand it!  How do I know which number after the slash belongs to my home network?  Any help/guidance an explaining this would be very much appreciate!

Thanks in advance!

EDIT 1:  Thank you everyone who replied and for not making me feel so dumb! haha  I now have a much better understanding of what this means! :)
gpt
It is a decimal representation of your subnet mask.

Your computer has an IP address. Something like:

    10.1.1.2

But this address represents two things: a) your computer; and b) the local network your computer is on. And it needs a way of knowing which part is which.^* To do this it uses what is known as a subnet mask which can be represented in a number of ways. The "slash" notation, followed by a number, is how many 1 bits are in the subnet mask, in the case of /24, that would be 24 1 bits.

Remember that computers deal in binary, so...

    10.1.1.2

Is actually:

    00001010.00000001.00000001.00000010

A subnet mask of 24 would be:

    11111111.11111111.11111111.00000000

Each bit of the IP address that lines up with a 1 bit in the mask is part of the network (in this case 10.1.1.x). Each bit of the IP address that lines up with a 0 bit in the mask is a host address (in this case x.x.x.2).

Your computer uses this information to determine if communication is destined for the local network (and doesn't need to go through a gateway) or is destined for a remote network (and does).

In this case, everything from 10.1.1.1 to 10.1.1.254 would be considered local. All other IP addresses would be remote.

\* - Originally, they designed a scheme where IP addresses would fall into certain classes that defined which part was the network part and which part was the host part. For example, if it began with a 10, then the first octet was automatically the network part and the last three would be the host part. This turned out to be insufficient for modern networking needs, so they developed the concept of subnetworking of which the subnet(work) mask allows us to chop up the address any way we want.