Subnet Calculator

Split an IPv4 address and a prefix into the mask, the network and the hosts. HEX and IP stay on HEX to IP

What this page does

An address and a prefix describe a network. This page lists the mask, the range and the host count. Writing the address as HEX stays on HEX to IP.

How to use it

  1. IPv4 address starts empty. Prefix starts at 24.
  2. Convert runs once. Show Example sets the address to 192.168.1.10 and Prefix to 24.
  3. The result numbers are mask 255.255.255.0, wildcard 0.0.0.255, network 192.168.1.0, broadcast 192.168.1.255, first host 192.168.1.1, last host 192.168.1.254, 254 hosts, and binary 11000000.10101000.00000001.00001010.
  4. Clear All clears the address, sets Prefix back to 24 and empties the result. Copy Result copies the lines.

Rules and edges

The address is four numbers from 0 to 255. The prefix is a whole number from 0 to 32. For a prefix of 30 or less, the network and broadcast addresses are reserved and the host count is the size minus 2. For /31 and /32 every address in the block counts as a host, and the first and last lines are the ends of that block. The labels in the result follow the page language. The numbers above do not.

Where people use it

  • Reading a /24 around 192.168.1.10.
  • Checking that 254 hosts fit between .1 and .254.
  • Copying the mask 255.255.255.0 into a config note.

Questions

Why is the host count 254 and not 256?

On a /24 the network address and the broadcast address are not hosts.

What changes at /32?

The single address is the host. There is no reserved network or broadcast.