Subnet Calculator

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

About This Tool

The Subnet Calculator is a free browser-based tool that helps network engineers, system administrators, and developers quickly compute IPv4 subnet details from a CIDR notation or an IP address with a prefix length. Whether you're planning a new network, configuring firewall rules, troubleshooting routing issues, or studying for a networking certification, this tool gives you 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 entirely in your browser using JavaScript bitwise operations. No IP addresses or network information are sent to any server. There are no API calls, no logging, and no third-party analytics on your input data. This makes the tool safe for use with production network details and sensitive infrastructure information.

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.