What is a subnet mask?

Reviewed by Hritik, White Fortress Academy · last reviewed 2026-11-11

A subnet mask is a number that tells a device which part of an IP address identifies the network and which part identifies the device. With the mask 255.255.255.0, the first three numbers of 192.168.1.20 are the network and the last number is the device.

How to read a subnet mask

  1. Write the mask in binary: 255.255.255.0 is 24 ones followed by 8 zeros.
  2. Every position with a 1 belongs to the network. Every position with a 0 belongs to the device.
  3. Devices with the same network part talk to each other directly. Traffic for any other network goes to the default gateway, which is the router.

Shorthand and size

The mask 255.255.255.0 is often written /24 because it has 24 ones. On a /24 network, 254 addresses can be given to devices, because the first address names the network and the last is the broadcast address.

Common mistakes

Questions people ask

What does /24 mean?

It means the first 24 bits of the address are the network part. It is the same as the mask 255.255.255.0.

What happens if the subnet mask is wrong?

The device may treat other computers as being on a different network and send their traffic to the router, or it may be unable to reach the gateway at all, so it can lose internet or printer access.

Also in the arcade: Binary Builder, a binary to decimal practice game · Network Setup Simulator, a router and switch setup practice game. Terms: subnet mask, ip address, default gateway. All quick answers · IT glossary

Plain-English guide by White Fortress Academy.