inyourbrowser.com

Subnet calculator

Enter a CIDR block (e.g. 192.168.1.0/24) to calculate the network address, broadcast address, subnet mask, usable host range, and total host count. Runs entirely in your browser.

Network address192.168.1.0
Broadcast address192.168.1.255
Subnet mask255.255.255.0
First usable host192.168.1.1
Last usable host192.168.1.254
Usable hosts254
Total addresses256
IP classC

/24 · 255.255.255.0 · 254 usable hosts

How it works

The tool parses the CIDR notation using pure JavaScript bit arithmetic. The prefix length determines the subnet mask; bitwise AND gives the network address; bitwise OR of the inverted mask gives the broadcast address. All host range calculations follow from there.

Processing runs in your browser

All calculations happen locally in the page. Our servers are not involved at any point.

Technical specification

Classless Inter-Domain Routing (CIDR) is defined in RFC 4632 (IETF, 2006). CIDR notation expresses an IPv4 network as address/prefix where the prefix length (0–32) specifies how many leading bits constitute the network portion. The subnet mask is derived by setting the top n bits to 1 and the remaining 32 − n bits to 0. Network address = address AND mask; broadcast = address OR (NOT mask). IPv6 CIDR follows the same principles with 128-bit addresses per RFC 4291.

Standard
RFC 4632. Classless Inter-domain Routing (CIDR)
Address space (IPv4)
32-bit; /24 = 256 addresses, /16 = 65,536
Subnet mask derivation
Top n bits = 1, remaining 32 − n bits = 0
Usable hosts
2^(32−prefix) − 2 (network + broadcast reserved)

Related operations

For working with file permission bits, try the chmod calculator. To convert IP octets between binary and decimal, use the number base converter. For converting between KB, MB, and GB in transfer planning, see the byte converter.

Frequently asked questions

What is a subnet?
A subnet (subnetwork) is a logical subdivision of an IP network. Subnetting divides a larger network into smaller segments to improve routing efficiency and security.
What is CIDR notation?
CIDR (Classless Inter-Domain Routing) notation represents an IP address and its associated network prefix length. For example, 192.168.1.0/24 means the first 24 bits are the network portion, leaving 8 bits for host addresses.
How many usable hosts does a /24 subnet have?
A /24 subnet has 256 total addresses (2^8). Two are reserved, the network address and the broadcast address, leaving 254 usable host addresses.
What is the difference between a network address and a broadcast address?
The network address is the first address in a subnet (all host bits set to 0) and identifies the subnet itself. The broadcast address is the last address (all host bits set to 1) and is used to send packets to all hosts in the subnet.
Does this calculator support IPv6?
Not currently. This tool focuses on IPv4 CIDR calculations.

Related tools

Byte converter
Convert between bytes, KB, MB, GB and TB in both decimal (SI) and binary (IEC) units.
Number base converter
Convert numbers between binary, octal, decimal, and hex. All bases shown at once.