Subnet Calculator - IP Subnet Mask & Network Calculator

IP Subnet Calculator

Compute subnet masks, host ranges, broadcast addresses, and binary masks instantly.

/

Binary Bit Representation

Subnet Summary

Networking Guide

How to Subnet an IP Address: A Complete Step-by-Step Guide

Subnetting is the process of dividing a larger IP network into smaller, more manageable subnetworks. It is one of the most fundamental skills for any network engineer, system administrator, or IT professional. By subnetting an IP address, you can efficiently allocate addresses, improve network security, reduce broadcast traffic, and simplify network management. This guide will walk you through how to subnet an IP address step by step.

Understanding the Basics of Subnetting

Every IP address has two parts: the network portion and the host portion. The subnet mask tells you which bits belong to each part. In CIDR notation, the prefix length after the slash indicates how many bits are used for the network. For example, in 192.168.1.0/24, the first 24 bits are the network, leaving 8 bits for hosts. To create subnets, you borrow bits from the host portion, which increases the prefix length and creates multiple smaller networks.

For example, if you have a /24 network (254 hosts) but only need 30 hosts per subnet, you can borrow 3 bits from the host portion. This gives you 2^3 = 8 subnets, each with 2^(8-3) - 2 = 30 usable hosts. The new subnet mask becomes /27 (255.255.255.224). Each subnet has its own network address, broadcast address, and range of usable IPs.

Step-by-Step Subnetting Process

To subnet an IP address, follow these steps: First, determine how many subnets you need and how many hosts per subnet. Next, calculate how many bits to borrow from the host portion using the formula 2^n >= required subnets, where n is the number of bits to borrow. Then, calculate the new subnet mask by adding the borrowed bits to the original prefix length. For example, to create 4 subnets from a /24, you need 2 borrowed bits (2^2 = 4), giving a new prefix of /26.

Once you have the new prefix, calculate the subnet size using 2^(remaining host bits). For a /26 (borrowed 2 bits from /24), you have 6 remaining host bits, giving 2^6 = 64 total addresses per subnet, with 62 usable. The subnets for 192.168.1.0/24 with a /26 mask would be: 192.168.1.0/26 (0-63), 192.168.1.64/26 (64-127), 192.168.1.128/26 (128-191), and 192.168.1.192/26 (192-255).

Each subnet has a network address (first address, all host bits 0), a broadcast address (last address, all host bits 1), and usable host addresses (everything between them). The network address and broadcast address cannot be assigned to devices. For 192.168.1.0/26, the network is 192.168.1.0, broadcast is 192.168.1.63, and usable hosts are 192.168.1.1 through 192.168.1.62.

Common Subnet Masks and Their Uses

Different subnet masks serve different purposes. A /30 (255.255.255.252) provides only 2 usable hosts and is perfect for point-to-point links between routers. A /29 (255.255.255.248) provides 6 usable hosts, ideal for small server clusters. A /27 (255.255.255.224) offers 30 usable hosts, suitable for office departments. A /26 (255.255.255.192) supports 62 hosts, good for medium-sized teams. A /24 (255.255.255.0) is the most common subnet, supporting 254 hosts for general office networks.

Understanding these common sizes helps you choose the right subnet for your needs. Using a /24 when you only need 10 addresses wastes 244 IPs. Proper subnetting ensures efficient use of your IP address space, whether you are working with a small home network or a large enterprise environment.

Using a Subnet Calculator

While manual subnetting is an important skill to learn, using a subnet calculator saves time and eliminates errors. This subnet calculator takes your IP address and prefix, instantly computing the network address, broadcast address, usable host range, subnet mask, and binary representation. It also shows a color-coded binary view so you can visualize exactly which bits represent the network and host portions.

The calculator is particularly useful when working with non-standard prefix lengths or when you need to verify your manual calculations. Simply enter an IP like 10.0.0.0 with a prefix of /18, and the calculator will show you the subnet boundaries, valid host addresses, and all related networking details instantly.

Subnetting is a critical skill that every networking professional must master. Whether you are studying for certifications like CompTIA Network+, Cisco CCNA, or simply managing your organization's network, understanding how to subnet IP addresses will help you design efficient, scalable, and secure networks. Practice with different prefix lengths and use this subnet calculator to verify your results as you learn.



Frequently Asked Questions

What are IP subnets?

IP subnets are logical subdivisions of an IP network. Subnetting divides a larger network into smaller, manageable pieces by borrowing bits from the host portion of an IP address to create a subnet identifier. Each subnet has its own network address, broadcast address, and range of usable host addresses. Subnets improve network performance, enhance security by isolating traffic, and make IP address management more efficient.

How to see IP subnet?

To see your IP subnet on Windows, open Command Prompt and type 'ipconfig' — look for the IPv4 Address and Subnet Mask. On macOS or Linux, type 'ifconfig' or 'ip addr' in the terminal. The subnet is determined by the combination of your IP address and subnet mask. For example, an IP of 192.168.1.100 with a mask of 255.255.255.0 means you are on the 192.168.1.0/24 subnet.

How can I know my subnet?

You can determine your subnet by performing a logical AND operation between your IP address and subnet mask. The result is your network address, which identifies your subnet. Alternatively, use this subnet calculator — enter your IP address and subnet mask, and it will instantly show your network address, broadcast address, host range, and CIDR notation.

What is a subnet ID?

A subnet ID (also called a subnet number or network address) is the first address in a subnet range where all host bits are set to 0. It identifies the subnet itself and cannot be assigned to any device. For example, in 192.168.1.0/24, the subnet ID is 192.168.1.0. The subnet ID is used by routers to determine which network a packet belongs to.

How to find my IP address?

To find your IP address on Windows, open Command Prompt and type 'ipconfig'. On macOS, go to System Settings > Network or type 'ifconfig' in Terminal. On Linux, type 'ip addr' or 'hostname -I'. To find your public IP address (the one visible to the internet), search 'what is my IP' on Google or visit a website like whatismyip.com.