Back to Home

IPv4/IPv6 Subnet Calculator

Calculate network address, broadcast address, and usable IP ranges.

/

Results

Network Address

192.168.1.0

Broadcast Address

192.168.1.255

Usable Host Range

192.168.1.1 - 192.168.1.254

Total Usable Hosts

254

Subnet Mask

255.255.255.0

Binary Subnet Mask

11111111.11111111.11111111.00000000

Interactive Bit-Level Visualizer

Click any bit to flip it and instantly update the IP address. Network bits are indigo, host bits are pink.

How to use this tool

  1. Enter the IP address

    Type any IPv4 address (like 192.168.1.1) or IPv6 address (like 2001:db8::1). The calculator accepts the full address including any leading zeros.

  2. Set the CIDR prefix

    Enter the prefix length after a slash, like /24 for IPv4 or /64 for IPv6. The prefix defines how many bits belong to the network versus the host.

  3. Read the network and broadcast addresses

    The calculator applies a bitwise AND to find the network address (first IP in the subnet) and a bitwise OR to find the broadcast address (last IP). Everything between those two is a usable host address.

  4. Check the usable host count

    For IPv4, subtract the network and broadcast addresses from the total to get usable hosts (a /24 gives 254). For IPv6, every address in the subnet is usable except the all-zeros network address.

About this tool

The Subnet Calculator is an essential tool for network engineers, sysadmins, and IT students. It takes any IPv4 or IPv6 address and a CIDR prefix (like /24 or /64) and instantly calculates the exact boundaries of that network segment.

Whether you are setting up a home lab, configuring AWS VPCs, or studying for the CCNA, this tool provides the exact network address, broadcast address, and usable IP range you need without having to do binary bit-shifting in your head.

How it works

The calculator converts your IP address into its raw binary representation. It then applies a bitwise AND operation using the subnet mask to find the Network Address, and a bitwise OR operation to find the Broadcast Address. The addresses between these two boundaries are your usable hosts.

IPv6 Support

IPv6 subnetting works on the exact same mathematical principles as IPv4, but uses 128-bit addresses instead of 32-bit. Because the numbers are astronomically large, this calculator uses native BigInt math to compute IPv6 network boundaries and host counts up to /128.

Pre-computed host counts and use cases for the most common CIDR notations.

Protocol head-to-heads that explain the addressing concepts this calculator works with, such as IPv4 vs IPv6.

Frequently asked questions

What is a Subnet Mask or CIDR?
A subnet mask defines which part of an IP address represents the network and which part represents the host. CIDR (Classless Inter-Domain Routing) is a shorthand for the subnet mask. For example, a /24 CIDR means the first 24 bits of the IP address are the network, leaving the last 8 bits for hosts.
How many usable IP addresses are in a /24 subnet?
A /24 subnet provides 256 total IP addresses, but 2 are reserved: the network address (first IP) and the broadcast address (last IP). This leaves 254 usable host addresses for devices like computers, phones, and printers.
What is the difference between IPv4 and IPv6?
IPv4 uses 32-bit addresses (e.g., 192.168.1.1), providing roughly 4.3 billion unique addresses. IPv6 uses 128-bit addresses (e.g., 2001:0db8::1), providing an astronomically large number of addresses (340 undecillion) to solve the IPv4 address exhaustion problem.
What is a broadcast address?
The broadcast address is the very last IP address in an IPv4 subnet. It is used to send data to all devices on that specific network segment simultaneously. In IPv6, broadcast addresses do not exist. Instead, multicast is used.