Break an IP address into its subnet. Enter an address and CIDR to see the network, broadcast address, mask and usable host range.

IP Subnet Calculator

Full subnet maths from one address and a prefix: network, broadcast, wildcard mask, usable range and binary netmask - including /31 and /32.

Free to use Wildcard & binary mask /31 & /32 done right Save PDF · PNG · Share

Enter your values

Fill in the fields below — the result appears with every step shown.

Shown on the printed, PDF and PNG copies of your result. Leave blank to stay anonymous.

Enter a valid value for ip address.

A dotted IPv4 address, for example 192.168.1.10.

/ bits

Enter a valid value for cidr prefix length.

The /n in CIDR notation, from 0 to 32.

Local browser calculation

Review your inputs and the tool’s supported scope before using the result.

Calculator loading… If this message stays, this view is not running the calculator's script — open this file in a full browser tab, then press Calculate.

Your result will appear here

Enter your values above, then press Calculate — or press Enter in any field.
TinyExe IP Subnet Calculator tinyexe.comFree online calculators

TinyExe · IP Subnet Result

Calculated locally in your browser

Calculated on
—

–
—

Name

—

IP address

—

CIDR prefix length

—

Result

—

How this was calculated

    What to do next

      TinyExe · tinyexe.com — Runs 100% in your browser — your numbers never leave this tab; nothing is uploaded or stored.

      TinyExe PDF & PNG exports carry the TinyExe logo and tinyexe.com header & footer.

      Runs 100% in your browser — your numbers never leave this tab; nothing is uploaded or stored.

      Embed this tool

      Add this IP Subnet Calculator to your own page — copy the code below and paste it where you want the tool to appear.

      The embed loads the live calculator in a frame, so it stays up to date automatically. Choose a width, check the code, then copy it. When you publish on WordPress, keep the src pointing at your live tool URL.

      Works in WordPress (Custom HTML block), HTML pages, and most site builders.

      The short answer

      An IP subnet calculator ANDs an IPv4 address with its netmask to find the network address and ORs it with the wildcard mask for the broadcast address. For 192.168.1.10/24 the network is 192.168.1.0, broadcast 192.168.1.255, wildcard 0.0.0.255, with 254 usable hosts from .1 to .254.

      • Network = IP AND netmask; broadcast = network OR wildcard mask
      • Usable hosts = 2^(32-prefix) - 2 for normal subnets
      • /31 has 2 usable addresses (RFC 3021); /32 is a single host route

      Common IPv4 subnet sizes

      Reference values for this calculator.

      CIDRNetmaskTotalUsable hosts
      /24255.255.255.0256254
      /25255.255.255.128128126
      /26255.255.255.1926462
      /28255.255.255.2401614
      /30255.255.255.25242
      /31255.255.255.25422 (RFC 3021)
      /32255.255.255.25511

      The formula

      The exact formula this calculator uses — every variable in it is explained in the card below.

      The formula

      Netmask = 32-bit mask with the first /n bits set; Network = IP AND netmask; Broadcast = Network OR wildcard (bitwise NOT of netmask); Usable hosts = 2^(32-n) - 2, except /31 = 2 (RFC 3021) and /32 = 1

      Ideas enhancement over the old limited kernel: returns the full subnet record in one run - wildcard mask, first and last usable host, binary netmask - and handles the two special cases home and office tools often get wrong: /31 point-to-point links (RFC 3021, both addresses usable) and /32 host routes (1 usable address).

      Worked examples

      Worked examples with the full working shown — try them in the calculator to check.

      Example 1

      Home LAN /24

      IP 192.168.1.10, prefix /24

      CalculationSteps
      Netmask /24 = 255.255.255.0 (binary 11111111.11111111.11111111.00000000). Network = IP AND netmask = 192.168.1.0; broadcast = network OR wildcard (0.0.0.255) = 192.168.1.255. Total addresses = 2^8 = 256; usable hosts = total - network - broadcast = 254. Usable range: first 192.168.1.1 to last 192.168.1.254.192.168.1.0/24 - 254 usable hosts — First usable 192.168.1.1, last usable 192.168.1.254, wildcard mask 0.0.0.255.

      Result

      Example 2

      Point-to-point /31 link

      IP 10.0.0.1, prefix /31

      CalculationSteps
      Netmask /31 = 255.255.255.254 (binary 11111111.11111111.11111111.11111110). Network = IP AND netmask = 10.0.0.0; broadcast = network OR wildcard (0.0.0.1) = 10.0.0.1. Total addresses = 2^1 = 2; RFC 3021 point-to-point link: both addresses are usable, so usable = 2. Usable range: first 10.0.0.0 to last 10.0.0.1.10.0.0.0/31 - 2 usable hosts — First usable 10.0.0.0, last usable 10.0.0.1, wildcard mask 0.0.0.1.

      Result

      Example 3

      Host route /32

      IP 172.16.5.4, prefix /32

      CalculationSteps
      Netmask /32 = 255.255.255.255 (binary 11111111.11111111.11111111.11111111). Network = IP AND netmask = 172.16.5.4; broadcast = network OR wildcard (0.0.0.0) = 172.16.5.4. Total addresses = 2^0 = 1; Host route: the single address is usable, so usable = 1. Usable range: first 172.16.5.4 to last 172.16.5.4.172.16.5.4/32 - 1 usable hosts — First usable 172.16.5.4, last usable 172.16.5.4, wildcard mask 0.0.0.0.

      Result

      How to use this calculator

      Step 1

      Enter any IPv4 address inside the subnet, in dotted decimal such as 192.168.1.10.

      Step 2

      Enter the CIDR prefix length - the number after the slash in 192.168.1.0/24.

      Step 3

      Press Calculate to see the network and broadcast addresses.

      Step 4

      Read off the wildcard mask and the first and last usable host addresses.

      Step 5

      Check the usable host count: remember /31 links have 2 usable addresses and a /32 is a single host route.

      In short: A subnet is a logical subdivision of an IP network, defined by a netmask (or CIDR prefix) that splits an address into network bits and host bits.

      Frequently asked questions

      What is a wildcard mask?

      The bitwise inverse of the netmask: where the netmask has 1s the wildcard has 0s and vice versa. A /24 netmask 255.255.255.0 has wildcard 0.0.0.255. Wildcard masks are used in Cisco ACLs and OSPF network statements.

      Why does a /31 have 2 usable addresses instead of 0?

      RFC 3021 allows /31 prefixes on true point-to-point links: with only two endpoints there is no need to reserve network and broadcast addresses, so both addresses carry traffic. It does not apply to ordinary LAN segments.

      What is a /32 used for?

      A /32 is a host route - a route to exactly one address. It is used for loopback interfaces, router IDs, and precise routing-table entries. It has 1 usable address: the host itself.

      How do I get the netmask from a CIDR prefix?

      Write the prefix as that many 1-bits followed by 0-bits, then convert each 8-bit group to decimal: /26 is 11111111.11111111.11111111.11000000, which is 255.255.255.192. The binary netmask is shown in this calculator's steps.

      Is this IPv4 or IPv6?

      This calculator is IPv4 only (32-bit addresses). IPv6 subnetting uses 128-bit addresses and /64 segments by default, and has no broadcast address or network/broadcast reservation.

      About this calculator

      An IP subnet calculator works out everything about an IPv4 subnet from a single address and its CIDR prefix: the netmask, network address, broadcast address, wildcard mask, the first and last usable host addresses, and how many hosts the subnet can hold - including the special /31 and /32 cases.

      Every IPv4 address is 32 bits. The CIDR prefix says how many of those bits name the network; the rest name hosts inside it. A /24 fixes the first 24 bits, leaving 8 host bits and 256 addresses. The netmask is that split written as an address - 255.255.255.0 for a /24 - and the network address is found by ANDing any member address with the mask, which zeroes the host bits.

      Two addresses in a normal subnet are reserved: the network address itself (all host bits 0) and the broadcast address (all host bits 1), which is the network address ORed with the wildcard mask. That is why a /24 has 254 usable hosts, not 256. The exceptions are deliberate: RFC 3021 lets point-to-point links use /31 with both addresses usable, and a /32 describes exactly one host.

      The wildcard mask, the bitwise opposite of the netmask, confuses people because it appears in Cisco access lists and OSPF statements rather than on host settings. This calculator shows it alongside the binary netmask so you can see the bit split directly instead of memorising decimal pairs.

      Use it when configuring routers, switches, firewalls and DHCP scopes, planning VLAN address space, writing Cisco ACLs (which need wildcard masks), or checking whether two hosts sit on the same network before troubleshooting a connection.

      How to calculate it yourself

      Step 1

      Write the IP and the netmask as 32-bit binary numbers (the steps show the binary netmask).

      Step 2

      AND the address with the netmask to get the network address.

      Step 3

      Invert the netmask to get the wildcard mask, then OR it with the network address for the broadcast address.

      Step 4

      Count addresses: total = 2^(32 - prefix); usable = total - 2 normally, 2 for a /31 link, 1 for a /32.

      Step 5

      The usable range runs from network + 1 to broadcast - 1 (or the full pair for /31, the single address for /32).

      Real-life examples

      Sizing a small-office VLAN

      An office needs addresses for 40 devices. A /26 gives 62 usable hosts while a /27 gives only 30, so the planner picks a /26 starting at 10.20.0.0 and checks the usable range before configuring DHCP.

      Netmask /26 = 255.255.255.192 (binary 11111111.11111111.11111111.11000000). Network = IP AND netmask = 10.20.0.0; broadcast = network OR wildcard (0.0.0.63) = 10.20.0.63. Total addresses = 2^6 = 64; usable hosts = total - network - broadcast = 62. Usable range: first 10.20.0.1 to last 10.20.0.62.

      10.20.0.0/26 - 62 usable hosts — First usable 10.20.0.1, last usable 10.20.0.62, wildcard mask 0.0.0.63.

      Checking a WAN link pair

      A provider hands over a /31 for a router-to-router link addressed from 203.0.113.8. The engineer verifies both .8 and .9 are usable under RFC 3021 instead of wasting a /30 with four addresses.

      Netmask /31 = 255.255.255.254 (binary 11111111.11111111.11111111.11111110). Network = IP AND netmask = 203.0.113.8; broadcast = network OR wildcard (0.0.0.1) = 203.0.113.9. Total addresses = 2^1 = 2; RFC 3021 point-to-point link: both addresses are usable, so usable = 2. Usable range: first 203.0.113.8 to last 203.0.113.9.

      203.0.113.8/31 - 2 usable hosts — First usable 203.0.113.8, last usable 203.0.113.9, wildcard mask 0.0.0.1.

      Ideas & use cases

      • Compare subnet sizes before allocating: run /25, /26 and /27 on the same base address and pick the smallest block that fits your device count with growth room.
      • Write ACLs faster: read the wildcard mask straight from the result instead of inverting the netmask by hand for Cisco entries.
      • Diagnose "same network?" problems: run both hosts' addresses at the configured prefix - if the network addresses differ, the hosts cannot talk directly without a router.

      Limitations & sources

      • IPv4 only - no IPv6, VLSM planning across multiple subnets, supernet aggregation, or DHCP pool advice. Private/public address-class notes are informational only.

      Sources: RFC 791 (Internet Protocol), RFC 4632 (CIDR), RFC 3021 (Using 31-Bit Prefixes on IPv4 Point-to-Point Links) · calculator.net IP Subnet Calculator behaviour cross-checked

      IP Subnet Calculator · TinyExe calculator suite Free to use · No sign-up · Instant results