Loading…

Developer tools10.09

IPv4 Subnet Calculator

Find the network address, broadcast address, host range, subnet mask, and wildcard mask of any IPv4 address from its CIDR prefix or mask.

Back to Developer tools

For example: 192.168.1.10, 10.0.0.0/8, or 172.16.5.4 255.255.240.0.

This runs entirely in your browser. We don’t store any data.

Network

Private (RFC 1918)

192.168.1.0/24

254 usable hosts

Subnet mask
255.255.255.0
Wildcard mask
0.0.0.255
Broadcast
192.168.1.255
Host range
192.168.1.1 – 192.168.1.254
Total addresses
256
Class (legacy)
C
IP in binary
11000000.10101000.00000001.00001010
Mask in binary
11111111.11111111.11111111.00000000

How to use it

  1. 01

    Enter an IPv4 address. You can include the prefix (192.168.1.10/24) or the mask (192.168.1.10 255.255.255.0).

  2. 02

    If you leave them out, pick a prefix from the drop-down list.

  3. 03

    You’ll see the network and broadcast addresses, the host range, the number of hosts, and the mask in both decimal and binary.

How it works

An IPv4 address has 32 bits, and the prefix tells you how many of them belong to the network: the first 24 in a /24. The network address is the IP ANDed with the mask, and the broadcast address sets every host bit to 1.

A subnet has 2^(32 − prefix) addresses. All of them except the network and broadcast addresses can be assigned, so a /24 has 254 usable hosts. The exceptions are /31 point-to-point links (RFC 3021), where both addresses are usable, and /32, which is a single host.

The wildcard mask is the inverse of the subnet mask and is used in router access control lists (ACLs). The class (A, B, C) predates CIDR and is shown for reference only.

Examples

  • Home network

    192.168.1.10/24 is on the 192.168.1.0 network, with hosts .1 through .254 and a broadcast address of 192.168.1.255.

  • A /26 subnet

    10.0.5.200 with mask 255.255.255.192 is in 10.0.5.192/26: 62 hosts, from .193 through .254.

  • Point-to-point link

    A /31 such as 203.0.113.6/31 has exactly two usable addresses.

Frequently asked questions

How many hosts does each prefix have?

/30: 2 · /29: 6 · /28: 14 · /27: 30 · /26: 62 · /25: 126 · /24: 254 · /23: 510 · /22: 1,022 · /16: 65,534.

Does it work with IPv6?

No, this calculator supports IPv4 only.