Skip to content
ENExplore Calculators

IPv4 Calculator

Calculate network address, broadcast address, host range and subnet mask for any IPv4 address.

About IPv4 Calculator

An IPv4 address combined with a prefix length defines a subnet. The network address is found by ANDing the IP with the subnet mask, the broadcast address by ORing the network address with the inverted mask. Usable host addresses fall between these two endpoints, excluding the network and broadcast addresses themselves.

Formulas

Network address

network = IP AND mask

IP
IPv4 address as 32-bit integer
M
Subnet mask (prefix 1s followed by 0s)

Usable hosts

hosts = 2^(32 - prefix) - 2

p
CIDR prefix length

Worked example

With the default values below, IPv4 Calculator returns Network Address of 192.168.1.0. Change any input above and every figure here is recalculated in your browser.

Inputs used

IPv4 Address
192.168.1.100
Prefix Length (CIDR)accepts 0–32
24

Results

Network Address
192.168.1.0
Subnet Mask
255.255.255.0
Broadcast Address
192.168.1.255
First Usable Host
192.168.1.1
Last Usable Host
192.168.1.254
Total Usable Hosts
254

Step by step

  1. 1Parse IP address= 3232235876Decimal integer: 3232235876
  2. 2Compute subnet mask= 255.255.255.024 bits set to 1
  3. 3Compute network address= 192.168.1.0
  4. 4Compute broadcast address= 192.168.1.255
  5. 5Calculate usable hosts= 254

Assumptions and limits

  • The result is derived only from the 2 inputs listed above. Anything not among them is not part of the calculation.
  • In particular, this calculator does not take inflation, tax, fees or charges or compounding frequency into account.
  • Figures are rounded for display to whole numbers, so totals built from several rounded parts can differ slightly from the unrounded arithmetic.

How these calculators are built and tested is described on the Methodology page. If a figure looks wrong, please report it.

Frequently Asked Questions

What is a CIDR prefix length?

The CIDR prefix length (e.g. /24) specifies how many leading bits of the 32-bit address are the network portion. A /24 means the first 24 bits identify the network and the remaining 8 bits identify hosts within it, giving 254 usable host addresses.

Why are two addresses subtracted for usable hosts?

The first address in the range is the network address (used to identify the subnet itself) and the last is the broadcast address (used to reach all hosts on the subnet simultaneously) — neither can be assigned to a host device.

IPv4 Calculator – Calculate Network Address & Subnet Mask