🌐 IP Subnet Calculator

Enter an IPv4 address and CIDR prefix to instantly get the network address, broadcast address, subnet mask, wildcard mask, usable host range, and IP address class.

🖧 Subnet Details
Enter a valid IPv4 address, e.g. 192.168.1.0 (each octet 0–255).
Four decimal octets separated by dots, each between 0 and 255.
A smaller number means a larger network; a larger number means a smaller subnet with fewer hosts.
📋 Subnet Breakdown
Network Address (CIDR)
Network Address
Broadcast Address
Subnet Mask
Wildcard Mask
First Usable Host
Last Usable Host
Total Addresses
Usable Hosts
IP Address Class

🔎 Address in Binary

⚠️ This tool performs standard IPv4 CIDR subnetting math. /31 subnets follow RFC 3021 (both addresses usable, point-to-point), and /32 represents a single host route. It does not validate reachability, routing, or whether the address is publicly routable — it is a pure calculation aid.
🌐

Enter an IP address and CIDR prefix to see the subnet breakdown

Guide

About the IP Subnet Calculator

Last updated: August 2026 · Reviewed by the NeftCal editorial team

Subnetting is the process of splitting a larger IPv4 network into smaller, self-contained segments — and doing the binary math by hand is tedious and error-prone. This IP subnet calculator takes any IPv4 address and CIDR prefix length (from /8 down to /30) and instantly returns the network address, broadcast address, subnet mask, wildcard mask, first and last usable host, total address count, usable host count, and the legacy IP address class, all computed with real bitwise operations rather than a lookup table.

What This Calculator Computes

It validates your IPv4 address, converts it to a 32-bit integer, derives the subnet mask from your chosen CIDR prefix, and runs bitwise AND/OR/NOT operations to compute the network address, broadcast address, wildcard mask, and usable host range.

Who Should Use This Calculator

Network administrators planning VLANs, cloud engineers sizing VPC CIDR blocks, students studying for networking certifications (CCNA, Network+), and anyone troubleshooting a "can't reach this device" issue caused by a subnet mask mismatch all need this exact bitwise subnetting math.

Why Subnetting Matters

Correct subnetting prevents two very common and disruptive networking mistakes: assigning overlapping address ranges to different network segments, and under- or over-sizing a subnet so it either runs out of host addresses too soon or wastes a large block of address space that could serve other segments. Whether you're designing VLANs for an office, carving out address space for a cloud VPC, or just studying for a networking certification, seeing the exact network boundaries, broadcast address, and usable host range for a given prefix removes the guesswork from IP address planning.

Real-World Applications

  • Sizing a cloud VPC CIDR block (AWS, Azure, GCP) before creating subnets per availability zone
  • Splitting an office /24 network into smaller VLANs by department or floor
  • Verifying a subnet mask matches what's configured on a router or DHCP server
  • Studying CIDR and subnetting for a networking certification exam
  • Cross-checking network design against your IP address management (IPAM) records

Tips for Accurate Results

  • Remember that the network address and broadcast address are never assignable to a device — only the range in between counts as usable hosts (with the /31 and /32 exceptions)
  • When you don't know the exact starting address of a subnet, enter any address within the range — the calculator determines the network address the same way a router would
  • Use a longer prefix (e.g. /28 or /29) for small point-to-point or device-limited segments, and a shorter prefix (e.g. /22 or /16) for larger networks
  • The IP address class shown is informational only; virtually all modern networks are addressed using CIDR rather than the old class-based rules
  • Double-check the CIDR prefix matches what's configured on your router or DHCP server — a mismatched mask is a common cause of connectivity issues
Formula

The Subnetting Formula, Explained

The bitwise math this calculator uses, the same a router's firmware performs

Subnet Mask
Mask = (0xFFFFFFFF << (32 − Prefix)) — sets the first N bits to 1

Network & Broadcast
Network Address = IP AND Mask  |  Wildcard Mask = NOT Mask  |  Broadcast = Network OR Wildcard

Host Range & Count
Total Addresses = 2^(32 − Prefix)  |  Usable Hosts = Total − 2 (except /31, /32)

The /31 exception (RFC 3021) treats both addresses in a 2-address block as usable, since there's no room for a separate network/broadcast address — the standard choice for point-to-point router links. A /32 identifies a single host with no range at all.

🧮

CIDR Notation

CIDR notation like /24 tells you how many of the 32 bits in an IPv4 address are the fixed "network" portion. The remaining bits are the "host" portion.

📡

Network vs. Broadcast

The network address (all host bits 0) identifies the subnet itself and the broadcast address (all host bits 1) reaches every device on it. Neither can be assigned to a host.

🏷️

IP Address Classes

Before CIDR, IPv4 space was divided into classes: A (1–126, /8), B (128–191, /16), C (192–223, /24), D (multicast), E (experimental). Legacy today, but still referenced.

⚙️ Why This Formula Works

IPv4 addresses are just 32-bit integers, and a CIDR prefix defines exactly where the network/host boundary sits within those 32 bits — so bitwise AND, OR, and NOT operations against the mask deterministically compute every subnet field, identical to how router hardware does it.

🎯 When to Use It

  • Before configuring a router, switch, or DHCP scope with a specific subnet
  • When sizing a cloud VPC or subnet for an expected device count
  • When verifying two networks don't have overlapping address ranges

📋 Assumptions

  • A well-formed IPv4 dotted-decimal address (four octets, 0-255 each)
  • Standard CIDR subnetting rules, with the /31 (RFC 3021) exception applied
  • IPv4 only — IPv6 prefix planning uses different, 128-bit arithmetic

⚠️ Limitations of the Formula

  • Doesn't detect overlapping ranges across multiple sites or VPCs
  • Doesn't verify routing reachability or actual address availability
  • Doesn't flag private (RFC 1918) vs public address ranges
  • IPv4-only — does not compute IPv6 prefixes
Walkthrough

Step-by-Step: How to Use the IP Subnet Calculator

From entering an address to reading the full subnet breakdown

Enter an IPv4 address

Type any IPv4 address in dotted-decimal form, such as 192.168.1.0 — you don't need to know the exact network address in advance.

Choose a CIDR prefix length

Select a prefix from /8 through /30 from the dropdown, which also previews the resulting subnet mask and usable host count.

Click Calculate Subnet

The calculator validates the address, converts it to a 32-bit integer, and runs the bitwise AND/OR/NOT operations needed to derive every subnet field.

Review the subnet breakdown

Read the network address, broadcast address, subnet mask, wildcard mask, first/last usable host, total addresses, usable hosts, IP class, and the binary view.

Export or reset

Download a plain-text summary with Export Result, or click Reset to return to the default address and prefix and calculate another subnet.

Example

Worked Example

Using the calculator's own default scenario — 192.168.1.0/24

Scenario

Suppose you enter the address 192.168.1.0 with a /24 CIDR prefix.

Address192.168.1.0
Prefix/24
Host Bits8
Step 1 — Subnet mask: first 24 bits set to 1 = 255.255.255.0.
Step 2 — Network address: 192.168.1.0 AND 255.255.255.0 = 192.168.1.0.
Step 3 — Wildcard mask: NOT 255.255.255.0 = 0.0.0.255.
Step 4 — Broadcast address: 192.168.1.0 OR 0.0.0.255 = 192.168.1.255.
Step 5 — Usable host range: 192.168.1.1 to 192.168.1.254 (254 usable hosts out of 256 total addresses).
Network
192.168.1.0
Broadcast
192.168.1.255
Usable Hosts
254

Explanation: A /24 leaves 8 host bits (2⁸ = 256 total addresses), and after reserving the network and broadcast addresses, 254 remain usable — the classic "Class C-sized" subnet, commonly used for small office LANs and home networks even though CIDR has replaced formal class-based addressing.

Interpretation

Understanding Your Subnet Result

What each result field means when configuring a network

FieldWhat It MeansHow to Use It
Network AddressIdentifies the subnet itselfUse as the subnet's route entry, not a host address
Broadcast AddressReaches every device on the subnetNever assign to a device
First/Last Usable HostThe assignable address rangeConfigure devices within this range
Usable HostsHow many devices the subnet can holdCompare against your expected device count plus growth

If usable hosts is smaller than your device count: choose a shorter prefix (fewer bits, e.g. /23 instead of /24) to get more host addresses.

If usable hosts is far larger than your device count: consider a longer prefix (more bits, e.g. /27) to avoid wasting address space that could serve another segment.

This tool's bitwise math is exact, but it can't detect overlapping ranges across your broader network — cross-check against your IPAM records before deploying.

ℹ️

This calculator performs exact bitwise subnetting math but does not validate reachability, routing, or whether an address is actually available on your network.

Use Cases

Practical Use Cases for the IP Subnet Calculator

Where exact subnet math genuinely helps

🏢

VLAN planning for an office

Split a larger network into per-department or per-floor VLANs with the right host count each.

☁️

Cloud VPC CIDR sizing

Size an AWS, Azure, or GCP VPC CIDR block before subdividing it per availability zone.

🏠

Home network configuration

Understand your router's default subnet and plan static IP assignments within it.

🔥

Firewall rule planning

Use exact network/broadcast boundaries when writing firewall or ACL rules by subnet.

📶

DHCP scope sizing

Set a DHCP pool's start/end addresses correctly within the usable host range.

🔗

Point-to-point link addressing

Use a /31 subnet for router-to-router WAN links per RFC 3021.

🎓

Networking certification study

Practice CIDR and subnetting problems for CCNA, Network+, or similar exams.

🛠️

Troubleshooting connectivity issues

Diagnose a mismatched subnet mask causing "can't reach this device" problems.

🖧

Data center network segmentation

Plan subnets for server racks, management networks, and storage VLANs.

🔀

VPN/peering CIDR conflict checks

Verify a candidate CIDR block doesn't overlap before setting up VPC peering or a VPN.

📚

Teaching subnetting concepts

Use it in a networking course to make binary AND/OR/NOT operations concrete.

🔁

Re-verifying after a network redesign

Recompute subnet boundaries whenever a network topology or IP plan changes.

Pros & Cons

Benefits and Limitations

What this IP subnet calculator does well, and where it can't replace network validation

✅ Benefits

  • Free, instant, and requires no signup or account
  • Exact bitwise math — identical to how router firmware computes subnets
  • Covers /8 through /30, plus RFC 3021 handling for /31
  • Shows network, broadcast, mask, wildcard, host range, and IP class in one view
  • Binary breakdown for visual/educational clarity
  • Accepts any address within a range, not just the exact network address
  • Downloadable plain-text summary of your result
  • Fast-loading, mobile-friendly, runs entirely in your browser
  • Useful for both quick lookups and certification study
  • No external API calls — your IP input never leaves your browser

⚠️ Limitations

  • Doesn't detect overlapping ranges across your broader network
  • Doesn't verify routing reachability or live address availability
  • Doesn't flag private (RFC 1918) vs public address ranges
  • IPv4-only — doesn't compute IPv6 prefixes
  • Doesn't validate against your actual router or DHCP configuration
  • Not a substitute for your organization's IPAM records
Reference

Common CIDR Prefix Reference Table

Subnet mask, total addresses, and usable hosts by prefix

PrefixSubnet MaskTotal AddressesUsable Hosts
/24255.255.255.0256254
/25255.255.255.128128126
/26255.255.255.1926462
/27255.255.255.2243230
/28255.255.255.2401614
/29255.255.255.24886
/30255.255.255.25242

Common Mistakes and Expert Tips

❌ Common Mistakes

  • Assigning the network or broadcast address to a device
  • Sizing a subnet based on legacy IP address class instead of actual device count
  • Creating overlapping CIDR blocks across VPCs before a peering connection
  • Forgetting the /31 exception when configuring point-to-point links
  • Mismatching the subnet mask between a router and connected devices
  • Not leaving growth room when choosing a prefix for a new segment

💡 Expert Tips & Best Practices

  • Choose the smallest prefix that comfortably covers your device count plus growth room
  • Use a /31 for point-to-point router links per RFC 3021 to avoid wasting a full /30
  • Cross-check candidate CIDR blocks against existing ones before a VPC peering or VPN setup
  • Pair with the Ping / Latency Calculator when troubleshooting network performance alongside addressing
  • Keep a written IPAM record of every subnet you allocate to avoid future overlaps
📝

Summary: This IP subnet calculator gives you an instant, free, exact bitwise breakdown of any IPv4 address and CIDR prefix — network address, broadcast address, mask, wildcard, and usable host range — removing the guesswork from subnetting. Pair it with the DNS Propagation Estimator and Bandwidth Calculator for a fuller networking toolkit.

FAQ

Frequently Asked Questions

Common questions about IP subnet calculator results

What is CIDR notation?
CIDR (Classless Inter-Domain Routing) notation, like 192.168.1.0/24, expresses an IP address followed by a slash and the number of bits used for the network portion of the address. A /24 means the first 24 bits are the network, leaving 8 bits (256 addresses) for hosts. CIDR replaced the older class-based (A/B/C) system defined in RFC 4632, letting networks be sized to whatever number of bits they actually need instead of fixed 8-bit boundaries.
How is the subnet mask calculated from a CIDR prefix?
The subnet mask is formed by setting the first N bits (the CIDR prefix length) to 1 and the remaining bits to 0, then writing the 32-bit result as four dotted-decimal octets. This calculator computes it as (0xFFFFFFFF << (32 − prefix)), which shifts in the right number of leading 1 bits. A /24 prefix produces the mask 255.255.255.0 because the first 24 bits are all 1s.
What is the difference between the network address and the broadcast address?
The network address is the lowest address in a subnet (all host bits set to 0) and identifies the subnet itself — it cannot be assigned to a device. The broadcast address is the highest address (all host bits set to 1) and is used to send a packet to every host on that subnet. Neither is usable as a normal host address; only the addresses strictly between them are assignable.
Why are two addresses subtracted from the total to get usable hosts?
Every subnet reserves its lowest address as the network address and its highest address as the broadcast address, so those two cannot be assigned to hosts. For a /24 (256 total addresses), that leaves 254 usable host addresses. The exceptions are /31, used for point-to-point links where both addresses are usable per RFC 3021, and /32, a single host route.
What do IP address classes A, B, and C mean?
Classes are a legacy (pre-CIDR) way of categorizing IPv4 address ranges by their leading bits: Class A (1–126) originally implied a /8 default mask, Class B (128–191) a /16, and Class C (192–223) a /24. Class D (224–239) is reserved for multicast and Class E (240–255) for experimental use. Modern networks use CIDR instead of class-based rules, but the class is still useful as a quick reference.
What is a wildcard mask and where is it used?
A wildcard mask is the bitwise inverse (NOT) of the subnet mask — where the mask has a 1, the wildcard has a 0, and vice versa. For a /24 mask of 255.255.255.0, the wildcard mask is 0.0.0.255. Wildcard masks are used in Cisco IOS access control lists (ACLs) and OSPF network statements, where they specify which address bits must match and which are treated as "don't care."
What happens with a /31 subnet?
A /31 subnet has only 2 total addresses and, under RFC 3021, both are treated as usable host addresses instead of reserving one as a broadcast address — there's no room for a separate network or broadcast address in a 2-address block. This makes /31 the standard choice for point-to-point WAN links between two routers, since it avoids wasting a full /30's worth of address space on a link that only ever has two endpoints.
What is a /32 subnet used for?
A /32 prefix identifies a single, specific IPv4 address with no host range at all — the network address and the address itself are the same, and there is no broadcast address. It's commonly used for host routes in routing tables, loopback interfaces on routers, and firewall or ACL rules that need to match exactly one IP address rather than a range.
How do I split a /24 network into smaller VLANs?
Run this calculator once per candidate prefix to compare host counts: a /24 split into four /26 subnets gives each VLAN 62 usable hosts, or split into eight /27 subnets gives each 30 usable hosts. Pick the smallest prefix that comfortably covers each VLAN's device count plus growth room, then assign each resulting network address to a separate VLAN so the ranges don't overlap.
Can I enter any IP address within a subnet and still get the right network address?
Yes. The calculator performs a bitwise AND between whatever address you enter and the subnet mask, which always resolves to the correct network address regardless of which host address within that range you typed — exactly how a router computes it. You don't need to already know or guess the network address before running the calculation.
What is the difference between a public and a private IP address?
Private IPv4 ranges (10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16, defined in RFC 1918) are reserved for internal networks and aren't routed on the public internet; devices using them reach the internet through NAT. Public addresses are globally unique and allocated by IANA and regional registries. This calculator performs the same subnetting math on both — it doesn't flag or restrict private versus public ranges.
How many usable hosts does a /27 subnet have?
A /27 prefix leaves 5 host bits, giving 32 total addresses (2^5) and 30 usable host addresses after subtracting the network and broadcast address. That makes /27 a common choice for a mid-sized office floor, a server rack, or a VLAN expected to hold roughly 15–25 devices with some headroom for growth.
Why can't I assign the network or broadcast address to a device?
Routers and switches use the network address (all host bits 0) to identify the subnet itself in routing tables, and the broadcast address (all host bits 1) to deliver a packet to every device on that subnet simultaneously. If a host were assigned either address, broadcast traffic or routing lookups could be misinterpreted, so both are reserved by convention across virtually all IPv4 equipment and operating systems.
What's the difference between IPv4 subnetting and IPv6 prefix planning?
The underlying concept is the same — a prefix length marks how many leading bits are the network portion — but IPv6 addresses are 128 bits instead of 32, so address exhaustion is essentially a non-issue and most organizations receive at least a /48 or /56 allocation. This calculator performs IPv4-specific 32-bit arithmetic only and does not compute IPv6 prefixes.
How do cloud providers like AWS and Azure use CIDR blocks?
AWS VPCs, Azure virtual networks, and GCP VPC networks are all defined by a CIDR block (e.g., 10.0.0.0/16), which you then subdivide into smaller subnets per availability zone or tier using the same bitwise math this calculator performs. Getting the initial VPC CIDR size right matters because expanding it later, or fixing overlapping ranges before a VPC peering or VPN connection, is far more disruptive than resizing an on-premises VLAN.
Is this calculator accurate enough for production network design?
The bitwise math is exact — the same AND/OR/NOT operations a router's firmware performs — so the network address, broadcast address, mask, and host counts it returns are correct for any valid IPv4 input. What it doesn't do is check your design against the rest of your network: it can't detect overlapping ranges across multiple sites, verify routing reachability, or confirm an address is actually available for use, so pair it with your IP address management (IPAM) records before deploying.
Learn More

Authoritative Resources on IPv4 Subnetting

Official standards documentation to complement this calculator

Related Calculators

Explore other tech tools