ip netmask calculator

IPv4 Netmask & Subnet Calculator

Enter an IPv4 address with either CIDR prefix or subnet mask. The calculator returns network details instantly.

/24 corresponds to 255.255.255.0
If provided, mask must be valid and match the prefix.

What an IP netmask calculator does

An IP netmask calculator helps you convert between subnet notation styles and instantly see the useful boundaries of a subnet: network address, broadcast address, host range, wildcard mask, and host capacity. It is one of the fastest tools for subnet planning, troubleshooting, and network documentation.

In day-to-day networking, people commonly switch between two formats:

  • CIDR prefix (such as /24, /27, or /30)
  • Dotted decimal mask (such as 255.255.255.0 or 255.255.255.224)

This page handles both and confirms they agree before calculating final results.

How to use this calculator

Step 1: Enter any IPv4 address inside your subnet

Example: 192.168.1.42. It does not need to be the network address itself.

Step 2: Enter a CIDR prefix, subnet mask, or both

For most tasks, entering only the prefix is enough. If you also provide a dotted mask, the calculator validates that both values match.

Step 3: Click Calculate

You will get the subnet summary, including network ID, broadcast, first/last usable host, and binary details.

Understanding each output field

  • Network address: The first address in the subnet; identifies the subnet itself.
  • Broadcast address: The final address in the subnet; sends traffic to all hosts in the segment.
  • Usable host range: The addresses that can normally be assigned to devices.
  • Total addresses: All addresses in subnet, including network and broadcast where applicable.
  • Usable hosts: Assignable addresses (special handling for /31 and /32).
  • Wildcard mask: Inverse of subnet mask, often used in ACLs.

Quick CIDR reference

  • /8 = 255.0.0.0 (16,777,216 total addresses)
  • /16 = 255.255.0.0 (65,536 total addresses)
  • /24 = 255.255.255.0 (256 total addresses)
  • /27 = 255.255.255.224 (32 total addresses)
  • /30 = 255.255.255.252 (4 total addresses)
  • /31 = 255.255.255.254 (commonly point-to-point links)
  • /32 = 255.255.255.255 (single host route)

Common subnetting mistakes to avoid

Mixing mismatched prefix and mask

A frequent error is entering /24 with 255.255.0.0. The calculator catches this and asks for correction.

Using the broadcast address as a host

In traditional IPv4 subnets (except special cases), the broadcast address should not be assigned to a normal endpoint.

Forgetting edge-case behavior on /31 and /32

/31 is typically treated as two usable endpoints for point-to-point links, while /32 represents one specific host.

Practical use cases

  • Designing VLAN sizes and address plans
  • Creating firewall and ACL rules with wildcard masks
  • Troubleshooting routing and subnet overlap issues
  • Documenting cloud VPC/VNet subnets for operations teams

Final note

Subnetting becomes easy with repetition. Use this IP netmask calculator as a quick verification step before provisioning devices, publishing routing changes, or writing ACLs. A ten-second check can prevent hours of network debugging later.

🔗 Related Calculators

🔗 Related Calculators