Tool

IPv4 Subnet, CIDR and Mask Calculator

Convert CIDR and masks or calculate the full range of an IPv4 subnet right in your browser.

Your data is processed locally in your browser and is not sent to our servers.

IPv4 subnet data

Convert a prefix or netmask. Add an IPv4 address to also calculate the network, broadcast and range.

Quick examples

Enter a CIDR prefix or IPv4 netmask.

Quick answer

Enter any IPv4 address in the block and a prefix or netmask. The result first explains which network contains the address and its usual host range, then keeps network, broadcast, mask, wildcard, sizes, and binary values available for copying or auditing. Quick examples compare /24, /27, /31, and /32 without manual setup.

Verifiable example

For address 192.168.1.42 with prefix /24, the result is:

Field Result
Network 192.168.1.0/24
CIDR prefix /24
Mask 255.255.255.0
Wildcard 0.0.0.255
Broadcast 192.168.1.255
First host 192.168.1.1
Last host 192.168.1.254
Total addresses 256
Usable addresses 254

The address belongs to that block because the first 24 bits identify the network and the remaining 8 identify addresses within it.

How to read each result

  • CIDR network combines the first address in the block with its prefix.
  • Network address is the lower endpoint; in /0 through /30 it identifies the subnet and is not assigned as a conventional host.
  • Broadcast is the upper endpoint in /0 through /30.
  • First and last usable delimit the conventional host range; /31 and /32 use the special rules explained below.
  • Wildcard inverts each mask bit and is used in configurations that express which bits may vary.
  • Total and usable addresses distinguish the complete block size from the addresses normally assignable to hosts.

Convert CIDR and mask without an IP address

You don’t need an address to convert the two notations. Enter 24, /24 or 255.255.255.0 in the prefix or mask field. The three values represent the same 24 network bits and produce:

Field Result
CIDR prefix /24
Mask 255.255.255.0
Wildcard 0.0.0.255
Directions 256
Regular hosts 254

If you add an IPv4, the tool applies that mask to calculate the specific limits of the block.

How to calculate an IPv4 subnet

An IPv4 address contains 32 bits. The CIDR prefix indicates how many belong to the network. The calculator creates the mask with those bits, applies an operation AND the address to get the network and use the remaining bits to find the last address of the block.

If you want to reproduce the procedure without depending on the tool, follow the guide how to calculate an IPv4 subnet step by step step, which solves a example /27 with block and binary size.

For prefixes from /0 to /30, the first address identifies the network and the last It is the broadcast. The addresses between both are the usable ones by hosts.

What happens to /31 and /32

A /31 network contains two addresses. In point-to-point links, both interpreted as host addresses and there is no dedicated broadcast, according to the RFC 3021.

A /32 route contains a single address and is used as a host route. The block size table RFC 4632 identifies /31 as point-to-point link and /32 as host route.

Common errors

  • Each octet must be a decimal number between 0 and 255.
  • The address must contain exactly four octets.
  • The prefix must be an integer between 0 and 32.
  • You can also write the prefix with /, for example /27.
  • A decimal mask must contain contiguous network bits; 255.0.255.0 is not a valid subnet mask.
  • The tool rejects leading zeros to avoid ambiguous interpretations.
  • The IP is optional and is written separately from the prefix or mask.

Borderline cases

  • /0 represents the entire IPv4 space: 4,294,967,296 addresses.
  • /31 returns two usable endpoints for a point-to-point link.
  • /32 returns a single address and does not show broadcast.
  • The calculator accepts any syntactically valid IPv4 without classifying it as public or private or infer whether it can be used on the Internet.
  • All calculation is done with 32-bit integers and you do not need to consult a external network.

Frequently asked questions

Does the address entered have to be the network address?

No. You can enter any address in the block. The result normalizes the network by applying the corresponding mask.

Can I convert a mask to CIDR without knowing the IP?

Yes. The equivalence depends only on the adjacent bits of the mask. For example, 255.255.255.224 is equivalent to /27 even if you do not enter an IP.

Why does a /24 have 254 usable addresses?

The block contains 256 addresses. In a conventional subnet, the first to identify the network and the last for broadcast.

Is the address I calculate saved?

No. Entry and results remain in the current tab and disappear when reloading or closing the page.

Reviewed on by Tools in a Tab.