IPv4 Subnet Calculator

Calculate network range, broadcast IP, and usable hosts from CIDR.

Save

Inputs

/

Your values stay on this device.

Results

Network Address
Subnet Mask255.255.255.0
Usable IP Range192.168.1.1 - 192.168.1.254
Broadcast Address192.168.1.255
Usable Hosts254

Report

Export and share

Document

Copy and share

Assumptions

  • This calculator is for IPv4 only and expects a dotted-quad address with four octets.
  • Usable-host math follows the traditional 2^(32 - CIDR) - 2 rule, so /31 and /32 show no traditional host range.
  • CIDR must be an integer from 0 through 32, and each IP octet must be an integer from 0 through 255.

Sensitivity preview

CIDR -10%: Network Address Invalid IP

CIDR Current: Network Address 192.168.1.0/24

CIDR +10%: Network Address Invalid IP

Related Tools

View All

About this IP Subnet Calculator

Subnetting allows network administrators to break a large network into smaller, more manageable pieces. This helps improve performance and security. This calculator performs the binary math required to determine the boundaries of a subnet based on a CIDR notation.

Who this calculator is for

  • Network engineers, sysadmins, and students working with IPv4 address plans.
  • Anyone sizing a subnet for home labs, offices, VLANs, or cloud networks.
  • Teams checking masks, broadcast addresses, and host counts before deployment.

When to use it

  • Use it to find the network address, subnet mask, and usable host range for an IPv4 subnet.
  • Use it when checking whether a CIDR block has enough usable hosts for a project.
  • Use it before configuring routers, firewalls, DHCP scopes, or cloud network segments.

How to use this calculator

  1. Enter an IP Address (e.g., 192.168.1.50).
  2. Select the CIDR (subnet bits) from the dropdown (e.g., /24).
  3. The tool calculates the Network ID, Broadcast IP, Netmask, and Usable Host Range.

Key assumptions

  • This calculator is for IPv4 only and expects a dotted-quad address with four octets.
  • Usable-host math follows the traditional 2^(32 - CIDR) - 2 rule, so /31 and /32 show no traditional host range.
  • CIDR must be an integer from 0 through 32, and each IP octet must be an integer from 0 through 255.

Accuracy and testing

Review formula sources, default test cases, assumptions, unit handling, rounding rules, and changelog for this calculator.

View accuracy page

How this calculator works

1. Netmask: Derived from CIDR (e.g., /24 = 255.255.255.0). 2. Network Address: Bitwise AND of IP and Netmask. 3. Broadcast Address: Bitwise OR of Network Address and inverted Netmask. 4. Hosts: 2^(32 - CIDR) - 2.

Inputs explained

IP Address

Any valid IPv4 address within the subnet.

CIDR

Classless Inter-Domain Routing. The number of bits set to 1 in the subnet mask.

Understanding your results

The Usable IP Range is strictly between the Network Address (first IP) and Broadcast Address (last IP). These are the IPs you can assign to devices.

Example scenarios

Home Network

IP 192.168.1.1 / 24. Mask 255.255.255.0. Range 192.168.1.1 - 192.168.1.254. Hosts 254.

Point-to-Point

IP 10.0.0.1 / 30. Mask 255.255.255.252. Range 10.0.0.1 - 10.0.0.2. Hosts 2.

Key Features

  • CIDR /0 to /32 support
  • Binary Calculation
  • Usable Host Range

Tips & Best Practices

  • A /32 subnet is a single IP (Host).
  • A /31 subnet is often used for point-to-point links on modern routers (2 usable IPs, no broadcast/network ID), but traditional math says 0 hosts.
  • The First usable IP is usually the Gateway.

Glossary of Terms

Subnet Mask
A 32-bit number that masks an IP address, and divides the IP address into network address and host address.
Broadcast Address
The last address in a subnet, used to send data to all devices in that subnet.
Network Address
The first address in a subnet, used to identify the subnet itself.

Frequently Asked Questions

Why -2 hosts?
In a standard subnet, the very first address is the Network Address and the very last is the Broadcast Address. Neither can be assigned to a specific device, so we subtract 2.
What is CIDR?
CIDR (Classless Inter-Domain Routing) notation represents the subnet mask as a count of leading 1-bits. For example, /24 means the first 24 bits identify the network.
What is a /30 used for?
A /30 provides exactly 2 usable addresses. It is commonly used to connect two routers directly.