IP Subnet Calculator
Calculate subnet masks, network addresses, and host ranges for IP networks. Plan and organize your network infrastructure with precise subnet calculations.
Calculate Your IP Subnet Calculator
What is IP Subnetting?
IP subnetting is the process of dividing an IP network into sub-networks to improve security, performance, and address allocation efficiency. By creating smaller network segments, organizations can better manage their network traffic, implement security policies, and reduce broadcast domains.
Understanding CIDR Notation
Classless Inter-Domain Routing (CIDR) notation is a compact method for specifying IP addresses and their subnet masks. It consists of an IP address followed by a forward slash (/) and a number that indicates how many bits are in the network prefix. For example, 192.168.1.0/24 represents a network with the first 24 bits used for the network portion and the remaining 8 bits used for host addressing.
Common CIDR Notations
- /24 — 256 addresses (254 usable)
- /25 — 128 addresses (126 usable)
- /26 — 64 addresses (62 usable)
- /27 — 32 addresses (30 usable)
- /28 — 16 addresses (14 usable)
- /29 — 8 addresses (6 usable)
- /30 — 4 addresses (2 usable)
- /31 — 2 addresses (2 usable, point-to-point)
- /32 — 1 address (single host)
Common Subnet Masks
- /8 — 255.0.0.0
- /16 — 255.255.0.0
- /24 — 255.255.255.0
- /25 — 255.255.255.128
- /26 — 255.255.255.192
- /27 — 255.255.255.224
- /28 — 255.255.255.240
- /29 — 255.255.255.248
- /30 — 255.255.255.252
Key Subnet Terminology
Network Address
The first address in a subnet, used to identify the network itself. This address cannot be assigned to a host.
Broadcast Address
The last address in a subnet, used to send data to all devices on that subnet. This address cannot be assigned to a host.
Host Range
The range of IP addresses that can be assigned to devices on the subnet. This range is from the first usable address (after the network address) to the last usable address (before the broadcast address).
Number of Hosts
The total number of usable addresses in a subnet. This is calculated as 2^(32-prefix) - 2, where the prefix is the CIDR notation value. The -2 accounts for the network and broadcast addresses.
Benefits of Subnetting
- Improved network performance: Smaller broadcast domains reduce unnecessary traffic.
- Enhanced security: Segregates network traffic and facilitates the implementation of security policies.
- Efficient address allocation: Allows organizations to use IP address space more efficiently.
- Better management: Simplifies network administration by organizing devices into logical groups.
- Reduced network congestion: Limits broadcast traffic to smaller segments of the network.
Subnetting Calculation Process
- Identify requirements: Determine how many subnets and hosts per subnet you need.
- Choose an appropriate CIDR prefix: Based on the number of hosts required.
- Calculate the subnet mask: Convert the CIDR prefix to a dotted-decimal subnet mask.
- Determine the network address: Apply the subnet mask to the IP address using a bitwise AND operation.
- Calculate the broadcast address: Set all host bits to 1 in the network address.
- Identify the host range: The usable addresses between the network and broadcast addresses.
Related Calculators
Frequently Asked Questions
IP subnetting is the process of dividing an IP network into smaller, more manageable sub-networks called subnets. This helps with network organization, efficient use of IP addresses, security, and performance optimization by reducing broadcast traffic.
CIDR (Classless Inter-Domain Routing) notation is a compact method for specifying IP addresses and their associated routing prefix. It consists of an IP address followed by a forward slash (/) and a decimal number that indicates how many bits are in the network prefix. For example, 192.168.1.0/24 indicates that the first 24 bits are used for the network portion, leaving 8 bits for host addresses.
To calculate the number of usable host addresses in a subnet, use the formula: 2^(32-prefix) - 2, where 'prefix' is the CIDR prefix length. For example, a /24 subnet has 2^(32-24) - 2 = 2^8 - 2 = 256 - 2 = 254 usable host addresses. The subtraction of 2 accounts for the network address and broadcast address, which cannot be assigned to hosts.
Network Address: The first address in a subnet, which identifies the network itself. It has all host bits set to 0 and cannot be assigned to a device.
Broadcast Address: The last address in a subnet, used to send data to all devices on that subnet. It has all host bits set to 1 and cannot be assigned to a device.
Common subnet masks and their CIDR equivalents include:
- 255.0.0.0 = /8 (Class A)
- 255.255.0.0 = /16 (Class B)
- 255.255.255.0 = /24 (Class C)
- 255.255.255.128 = /25
- 255.255.255.192 = /26
- 255.255.255.224 = /27
- 255.255.255.240 = /28
- 255.255.255.248 = /29
- 255.255.255.252 = /30
A subnet mask is a 32-bit number that masks an IP address, dividing it into network and host portions. In a subnet mask, all bits in the network portion are set to 1 and all bits in the host portion are set to 0. For example, the subnet mask 255.255.255.0 (binary: 11111111.11111111.11111111.00000000) indicates that the first 24 bits identify the network, while the last 8 bits identify hosts on that network.
Subnetting serves several important purposes in network design and management:
- Reduces network traffic by limiting broadcast domains
- Improves security by segmenting networks
- Enables more efficient use of IP address space
- Facilitates network management and troubleshooting
- Improves routing efficiency by creating hierarchical addressing
- Enables the implementation of access control between network segments
A /31 subnet is specifically designed for point-to-point links between exactly two devices, such as router-to-router connections. Traditional subnetting rules state that each subnet needs a network address and a broadcast address, making /30 (with 4 addresses) the smallest practical subnet with 2 usable host addresses. However, RFC 3021 defined the use of /31 subnets for point-to-point links, eliminating the need for network and broadcast addresses and allowing both addresses to be assigned to hosts, thus conserving IP address space.
Share This Calculator
Found this calculator helpful? Share it with your friends and colleagues!