Subnet Calculator

Calculate IPv4 subnet details from a CIDR notation or IP address with prefix length.

About This Tool

Every network engineer eventually needs to convert CIDR notation into usable subnet details — and doing it by hand is slow and error-prone. This free browser-based calculator takes a CIDR block or an IP address with a prefix length and instantly returns the full breakdown: network address, broadcast address, host range, and more. with a prefix length. It is widely used during network planning, firewall configuration, routing troubleshooting, and certification study — delivering instant answers without leaving your browser.

Subnetting is the practice of dividing a larger IP network into smaller, more manageable sub-networks called subnets. Each subnet is defined by a network address and a subnet mask (also expressed as a CIDR prefix length like /24). The subnet mask determines how many bits of the 32-bit IPv4 address are reserved for the network portion and how many remain for host addresses. Understanding this division is essential for efficient IP address allocation, reducing broadcast traffic, and implementing network security boundaries.

CIDR (Classless Inter-Domain Routing) replaced the older classful addressing scheme and allows flexible allocation of IP address space. Instead of being limited to Class A (/8), Class B (/16), or Class C (/24) boundaries, CIDR lets you use any prefix length from /0 to /32. This flexibility is critical for modern networks where address space must be conserved and allocated precisely.

This calculator performs all computations client-side using bitwise operations on 32-bit integers, exactly the same way routers and operating systems handle IP addressing internally. Your IP addresses and network data never leave your machine — there are no server requests, no data logging, and no third-party tracking. This makes it safe for use with production network details and internal infrastructure planning.

How to Use

  1. Enter a CIDR notation (e.g. 192.168.1.0/24) in the top input field, or enter an IP address and prefix length separately in the two fields below.
  2. Results appear instantly showing the network address, broadcast address, subnet mask, wildcard mask, host range, and more.
  3. The binary representation shows the IP address with network bits highlighted in blue and host bits in amber for easy visualization.
  4. Click the copy icon next to any result value to copy it to your clipboard.
  5. Use Ctrl+Shift+C to quickly copy the CIDR notation.
  6. Click Clear to reset all inputs and start a new calculation.

About This Tool

View all 20 subnet guides →

FAQ

What is CIDR notation?

CIDR (Classless Inter-Domain Routing) notation is a compact way to express an IP address and its associated subnet mask. It is written as an IP address followed by a forward slash and a prefix length, for example 10.0.0.0/8. The prefix length indicates how many of the 32 bits in the IPv4 address are used for the network portion. A /24 prefix means the first 24 bits are the network part, leaving 8 bits (256 addresses) for hosts.

What is the difference between a subnet mask and a wildcard mask?

A subnet mask has all network bits set to 1 and all host bits set to 0 (e.g. 255.255.255.0 for a /24 network). A wildcard mask is the bitwise inverse: all network bits are 0 and all host bits are 1 (e.g. 0.0.0.255). Subnet masks are used by operating systems and routers for general networking, while wildcard masks are commonly used in access control lists (ACLs) on Cisco routers and in OSPF configuration.

What are private IP address ranges?

RFC 1918 defines three private address ranges that are not routable on the public internet: 10.0.0.0/8 (10.0.0.0 - 10.255.255.255), 172.16.0.0/12 (172.16.0.0 - 172.31.255.255), and 192.168.0.0/16 (192.168.0.0 - 192.168.255.255). Additionally, 127.0.0.0/8 is reserved for loopback addresses. This calculator automatically detects whether an IP falls within a private or public range.

Why are there 2 fewer usable hosts than total addresses?

In a standard IPv4 subnet, two addresses are reserved: the first address is the network address (identifies the subnet itself) and the last address is the broadcast address (used to send packets to all hosts on the subnet). Therefore, a /24 network has 256 total addresses but only 254 usable host addresses. For /31 networks (point-to-point links as defined in RFC 3021), both addresses are usable. A /32 represents a single host address.

Is my data safe when using this tool?

Yes. All subnet calculations are performed in your browser using JavaScript's 32-bit bitwise operators (AND, OR, NOT, shift). No IP addresses or network information leave your device — there are no fetch calls, no WebSocket connections, and no localStorage persistence. You can verify this in the Network tab of your browser's DevTools.

Related Tools

Number Base Converter

Convert numbers between binary, octal, decimal, hexadecimal, and custom bases with bit visualization.

Chmod Calculator

Convert between symbolic (rwx) and numeric (octal) Unix file permissions interactively.

Hash Generator

Generate MD5, SHA-1, SHA-256, and SHA-512 hashes for text and files.

UUID Generator

Generate, validate, and inspect UUIDs in v4 and v7 formats.

Cloud Region Comparison

Compare AWS, Azure, and GCP regions side by side. Search by location, view region codes, availability zones, and latency estimates.

Uptime Calculator

Calculate SLA uptime percentages and equivalent downtime in days, hours, minutes, and seconds. Compare nines of availability with reverse downtime calculator.

IP Range to CIDR Converter

Convert start-to-end IP address ranges into minimal CIDR notation blocks. Reverse CIDR to IP range, batch mode, host count display.

CIDR Range Calculator

Calculate CIDR ranges, detect overlaps, check containment, and merge IP blocks. Shows network, broadcast, subnet mask, and host count.

IPv6 Expander / Compressor

Expand and compress IPv6 addresses. Convert between full and shorthand notation with type detection and binary representation.

Network Bandwidth Calculator

Calculate file transfer times based on file size and bandwidth. Compare speeds across 4G, 5G, WiFi 6, Ethernet, and USB connections.

IP Address Analyzer

Analyze IPv4 and IPv6 addresses to see class, type, binary representation, private/public status, and IANA reserved range information.

Port Number Reference

Browse and search 100+ well-known, registered, and dynamic TCP/UDP port numbers with service names and protocol details.