Skip to main content

What Do The Four Numbers In An IP Address Mean?

Last updated on 11 min read

Each of the four numbers in an IPv4 address is an 8-bit octet (0–255), and together they form a 32-bit binary number like 192.168.1.100; the slash notation (e.g., /24) tells devices how many leading bits define the network, while the remaining bits identify a specific host on that network.

What’s Really Happening

An IPv4 address is a 32-bit binary number broken into four 8-bit octets, each ranging from 0 to 255. The CIDR notation (the /24 in 192.168.1.100/24) tells devices how many of those 32 bits are locked for the network.

Imagine it like a street address: the first three octets (say, 192.168.1) act as the neighborhood, while the last octet (100) is the house number. The subnet mask (255.255.255.0 for /24) acts like a filter that hides the host portion so routers know which part matters. Switch to /16 and suddenly 192.168.x.x becomes your whole local network—handy for offices, overkill for most homes.

That’s why your phone can chat with your smart TV without ever touching the internet. Those four numbers aren’t just labels; they’re the actual wiring behind how data moves.

Step-by-Step Solution

To fix subnet issues, confirm your IP and mask, split the address to separate network from host bits, test basic connectivity, and only tweak the mask if needed. Make sure devices on the same network can “see” each other before assuming something’s broken.

  1. Grab your IP and mask in one step
    • Windows 11 (2026): Hit Win + R, type cmd, then Enter. Run:
      ipconfig /all
      Look under the correct adapter for “IPv4 Address” and “Subnet Mask.” If you see “192.168.1.100” and “255.255.255.0,” you’re on a /24 network. Pro tip: If you’re fixing a printer, check its web interface—some default to weird masks.
    • macOS Sequoia (2026): Open Terminal (Applications → Utilities → Terminal). Run:
      ifconfig | grep "inet " | grep -v 127.0.0.1
      Note the IPv4 and netmask. If it shows “netmask 0xffffff00,” that’s hex for 255.255.255.0, or /24. Adjust for different subnets.
    • Ubuntu 24.04 LTS: Open Terminal. Run:
      ip a
      Find your interface (usually eth0 or wlan0). The line starting with “inet” shows something like “192.168.1.100/24.” If you see “/25” or “/26,” that’s your CIDR mask—no conversion needed.
  2. Split the address by hand Take the CIDR (e.g., /24) and turn it into a dotted mask: /24 → 255.255.255.0. Write out the 32-bit binary for both the IP and mask. Example:
    Octet1921681100
    Binary IP11000000101010000000000101100100
    Binary Mask (/24)11111111111111111111111100000000
    Network Bits192.168.1(fixed)
    Host Bits(0)100 (device-specific)

    With a /16 mask, the network bits cover the first two octets (192.168), leaving the last two octets (up to 65,534 hosts) for devices. Offices love this, but homes usually stick with /24—it’s plenty. Set a /16 at home by accident? Your router might choke trying to track devices you don’t even own.

  3. Test basic connectivity
    • Ping yourself to confirm the interface is alive:
      ping 192.168.1.100
    • Ping your router (usually the first address, like 192.168.1.1):
      ping 192.168.1.1
    • Try pinging another device on the same network, like a printer or laptop:
      ping 192.168.1.50

    If you can ping the router but not another device, the problem’s likely on that device’s IP or firewall. Can’t reach the router? Double-check your IP and mask. Nine times out of ten, it’s a typo in the mask or a messed-up default gateway.

  4. Adjust the mask if needed
    • Windows: Head to Settings → Network & Internet → Change adapter options → right-click your adapter → Properties → IPv4 → Properties. Pick “Use the following IP address” and enter:
      • IP address: 192.168.1.100
      • Subnet mask: 255.255.255.0
      • Default gateway: 192.168.1.1 (or your router’s IP)
      Click OK and restart the adapter if needed. (Setting a static IP? Make sure it’s outside your router’s DHCP range to dodge conflicts.)
    • macOS: Go to System Settings → Network → Wi-Fi/Ethernet → Details → TCP/IP. Choose “Manually” and type:
      • IPv4 Address: 192.168.1.100
      • Subnet Mask: 255.255.255.0
      • Router: 192.168.1.1
      Click OK and reconnect.
    • Linux (Ubuntu/Fedora): Edit your Netplan config (Ubuntu) or use nmtui (Fedora). For Netplan, open /etc/netplan/01-netcfg.yaml and set:
      addresses: [192.168.1.100/24]
      gateway4: 192.168.1.1
      Then run sudo netplan apply.

If This Didn’t Work

If devices still can’t see each other after following the steps, check for duplicate IPs, firewall rules, or mismatched VLANs. Start with the basics: confirm no two gadgets are sharing the same last octet (say, both 192.168.1.100), then verify firewalls aren’t blocking local traffic.

Try rebooting everything—router, switch, and devices—then retest. If the issue persists, check your router’s admin page (usually 192.168.1.1) for VLAN or DHCP settings that might be isolating your devices. Still stuck? Plug a laptop directly into the router with an Ethernet cable to rule out Wi-Fi issues.

As of 2026, most consumer routers use UPnP to auto-configure masks, but manual overrides can break things if the mask isn’t updated alongside the IP. Double-check both together.

Prevention Tips

To keep your subnet from going sideways, document your network’s IP scheme, reserve static IPs for critical devices, and avoid /8 or /16 masks at home. Stick to /24 for home networks and /22 or /23 for small offices; anything larger invites chaos.

Use your router’s DHCP reservation feature to pin IPs to MAC addresses, so printers, cameras, and NAS boxes always get the same address. Record your scheme in a spreadsheet or note app—future-you will thank present-you when troubleshooting. If you’re playing with VLANs, keep each VLAN on its own subnet and label the ports clearly. And for the love of packets, don’t set a /8 (255.0.0.0) unless you’re running Google’s backbone.

Can I use a /8 or /16 mask at home?

No—/8 (255.0.0.0) and /16 (255.255.0.0) masks are overkill for home networks and can cause performance or security issues. Stick to /24 (255.255.255.0) for simplicity and safety.

A /16 mask lets your router track up to 65,534 devices, which is way more than your home needs and can overwhelm consumer hardware. Worse, it can expose parts of your network to unintended traffic if not configured carefully. Most home routers default to /24 for a reason—it’s enough for 254 devices and keeps broadcasts contained. If you’re tempted by the extra space, ask yourself: do you really need 100 smart bulbs? Use VLANs instead to segment devices without inflating your subnet.

According to Google Nest Help, consumer routers aren’t designed for large subnets, and performance drops sharply once you exceed ~200 devices.

What if my ISP gives me a /32?

If your ISP assigns a /32 (e.g., 203.0.113.45/32), it means your single public IP is treated as its own /32 network—no local subnet. You’ll need to configure your router to handle a single public IP and use NAT for your internal devices.

A /32 is common for mobile hotspots or point-to-point links, but it breaks traditional LAN setups because there’s no room for a network address. Your router must perform 1:1 NAT or use a proxy ARP workaround to share that single IP across devices. Most home routers handle this automatically, but if you’re using a custom firewall or embedded device, you may need to add a static route or proxy ARP entry. Check your router’s admin page for “Single Public IP” or “1:1 NAT” options.

The IETF RFC 4632 defines /32 as a single-host route, so ISPs use it to avoid wasting addresses on tiny point-to-point links.

How do I tell if my subnet mask is wrong?

Your subnet mask is likely wrong if devices on the same network can’t ping each other, or if you see “Destination host unreachable” despite correct IP assignments. Compare the mask shown in your OS with the one on your router’s admin page.

A common symptom is one device working while others in the same room don’t. Check both the IP and mask on each device—mismatched masks (say, one device at /24 and another at /25) will break local communication. Another clue: your router’s DHCP server might offer a mask that doesn’t match your manual configs. Pull the mask from the router’s admin page (usually 192.168.1.1) and compare it with what your devices report in ipconfig or ip a.

Why does my Linux box show /24 but my Windows box shows 255.255.255.0?

Linux typically displays the CIDR notation (e.g., /24), while Windows shows the dotted-decimal mask (255.255.255.0)—they represent the same value. CIDR is just a shorthand for the same binary mask.

It’s not a difference in the subnet itself; it’s a difference in how the OS chooses to display it. Windows defaults to dotted-decimal because it’s more human-readable, while Linux prefers CIDR for scripts and automation. You can convert between them easily: /24 = 255.255.255.0, /16 = 255.255.0.0, /8 = 255.0.0.0. If you’re scripting, stick with CIDR for consistency.

The MDN Web Docs explain that CIDR notation is just a compact way to write the same binary mask you’d see in dotted-decimal.

What’s the difference between a subnet mask and a gateway?

A subnet mask defines which part of your IP is the network and which part is the host, while a gateway (router) is the device that forwards traffic between networks. The mask keeps local traffic local; the gateway handles everything else.

Think of the mask as a road sign that says, “Local traffic stays on this street,” and the gateway as the traffic cop that sends out-of-network traffic to the highway. If your mask is /24, your local network is 192.168.1.0–192.168.1.255; anything outside that range goes to the gateway (usually 192.168.1.1). Without a gateway, your devices can talk locally but can’t reach the internet.

According to Apple Support, the gateway must be on the same subnet as your device for routing to work.

Can two devices have the same IP if they’re on different subnets?

Yes—devices on different subnets can share the same IP without conflict, because routers treat them as separate networks. The IP only needs to be unique within its own subnet.

Imagine two offices using the same phone extension number: if one is in New York and the other in London, the calls don’t collide. The same logic applies to IPs. As long as the subnets are distinct (say, 192.168.1.0/24 and 10.0.0.0/24), two devices can both be “192.168.1.100” without issues. However, if those devices ever connect to the same subnet, one will have to change its IP to avoid a conflict.

The Cisco documentation confirms that IP uniqueness is enforced per subnet, not globally.

What happens if I set my mask to 255.255.0.0 on a /24 network?

Setting a /16 mask (255.255.0.0) on a router that expects /24 will widen the local network to 192.168.0.0–192.168.255.255, potentially causing routing conflicts. Devices that were on 192.168.1.x may suddenly appear on a different subnet.

If your router is set to 192.168.1.1/24 but you change the mask to 255.255.0.0, the router now thinks 192.168.0.0–192.168.255.255 is local. This can break connectivity for devices that were previously reachable, and it may cause IP conflicts if another device on 192.168.2.x already exists. Worse, it can expose your internal traffic to parts of your network you didn’t intend to share. Always double-check the mask on both the router and devices after making changes.

The IETF RFC 1519 warns against mismatched masks in the same broadcast domain.

How do I find the network address from an IP and mask?

To find the network address, perform a bitwise AND between the IP and the subnet mask. Convert both to binary, align the bits, and keep the network bits while zeroing out the host bits.

Example: IP 192.168.1.100 (11000000.10101000.00000001.01100100) AND mask 255.255.255.0 (11111111.11111111.11111111.00000000) = 192.168.1.0. The host bits (last octet) become 0. If your mask is /30 (255.255.255.252), the network address would be 192.168.1.64 for an IP like 192.168.1.70. Most OSes and routers do this automatically when routing, but knowing the manual method helps diagnose misconfigurations.

You can use the ipcalc Linux tool or an online subnet calculator like Calculator.net to verify your work.

Why do some routers use 255.255.255.254 as a mask?

Routers use 255.255.255.254 (/31) for point-to-point links because it conserves IP space by treating the two endpoints as a single subnet. It’s a /31 mask, which gives exactly two usable addresses per link.

Traditionally, subnets needed two reserved addresses (network and broadcast), but /31 masks skip those and let both endpoints use their IPs for data. This is common on ISP links, VPN tunnels, and wireless backhauls where only two devices talk to each other. Consumer routers rarely use /31, but enterprise gear and ISP CPEs do. If you see this mask in your router’s admin page, it’s likely serving a dedicated point-to-point link, not a LAN.

The IETF RFC 3021 defines /31 for point-to-point links, eliminating waste in address allocation.

What’s the smallest subnet I can use?

The smallest practical subnet is /31 (255.255.255.254), which provides exactly two usable IP addresses for a point-to-point link. Anything smaller (/32) is a single-host route with no room for a second device.

For real networks, /30 (255.255.255.252) is the smallest subnet with usable hosts—it gives two usable IPs (say, 192.168.1.5 and 192.168.1.6) for a small router-to-router link. /31 is used in specialized cases where broadcast isn’t needed, like ISP backhauls. Avoid going smaller than /30 unless you’re running a /31 point-to-point link; otherwise, you’ll run out of usable addresses quickly.

According to IETF RFC 3021, /31 is the smallest subnet that still allows bidirectional communication.

Edited and fact-checked by the FixAnswer editorial team.