Subnet Calculator - IPv4 CIDR, Netmask and Host Range

Tools / Dev Tools / Subnet Calculator

IPv4 subnet calculator

IPv4 only. Write 192.168.1.10/24, 10.0.0.5 255.255.0.0, or just the address and pick the mask from the list.

Network address
192.168.1.0
Broadcast address
192.168.1.255
Usable hosts
254
CIDR notation
192.168.1.0/24
Usable host range —
First host —
Last host —
Total addresses —
Subnet mask —
Wildcard mask —
Address class —
Address type —
Binary
Address —
Mask —
Network —

Colored bits belong to the network part; the rest are host bits.

How subnet calculation works

An IPv4 address is a 32-bit number. The prefix length (the /24 part) says how many of those bits, counted from the left, identify the network; the remaining bits number the hosts inside it. Everything else, from the broadcast address to the host count, follows from that one split.

How to use it

  1. 1 Type an address with its prefix, such as 10.20.30.40/22, or an address followed by a dotted mask.
  2. 2 Read the network, broadcast and usable host range. The mask list next to the field updates with what you type, and changing it rewrites the prefix.
  3. 3 To plan smaller networks, pick a longer prefix under "Split into": the list shows every resulting subnet with its host range.

Why a /24 has 254 hosts, not 256

Eight host bits give 256 addresses, but two are taken: the first (all host bits 0) names the network itself and the last (all 1) is the broadcast address. So the usable count is 2 to the power of the host bits, minus 2. The two exceptions are /31, where RFC 3021 lets both addresses be hosts on a point-to-point link, and /32, which is one single host.

Network address with AND, broadcast with OR

The network address is the IP AND the mask: host bits are cleared. The broadcast address is the network OR the wildcard (the inverted mask): host bits are all set. Example: 172.20.77.9/20 has a mask of 255.255.240.0, so the third octet 77 becomes 64 and the network is 172.20.64.0; the broadcast is 172.20.79.255. The block size in the octet where the prefix ends is 256 minus the mask value there, here 16.

Private, CGNAT and other special ranges

Three blocks are private and never routed on the internet: 10.0.0.0/8, 172.16.0.0/12 (172.16 to 172.31, not all of 172.x) and 192.168.0.0/16. 100.64.0.0/10 is shared address space used by carrier-grade NAT; if your router shows a WAN address there, you are behind your provider’s NAT. 127.0.0.0/8 is loopback, 169.254.0.0/16 is link-local (often a sign that DHCP failed), and 192.0.2.0/24, 198.51.100.0/24 and 203.0.113.0/24 are reserved for examples in documentation.

Address classes are history

Class A, B and C (first octet 0-127, 128-191, 192-223) fixed the prefix at /8, /16 and /24 until CIDR replaced them in 1993. The class is shown because exams and older equipment still ask for it, but it tells you nothing about the real mask: 10.1.2.3/24 is "class A" and still has 254 hosts. Class D (224-239) is multicast and class E (240-255) is reserved. This tool handles IPv4 only; IPv6 uses 128-bit addresses and has no broadcast at all.

Subnetting questions

/24: 256 addresses, 254 usable. /27: 32 addresses, 30 usable. /29: 8 addresses, 6 usable. /30: 4 addresses, 2 usable, the classic size for a router-to-router link before /31 became common. Each extra prefix bit halves the block.
New
Chmod Calculator Tick read, write and execute boxes or type 755 or rwxr-xr-x and get both chmod commands. Handles setuid, setgid and the sticky bit.
Popular Today
MD5 Hash Generator Free MD5 hash generator: turn any text or file into an MD5 checksum in your browser - useful for integrity checks and quick fingerprinting.

Related Dev Tools

MD5 Hash Generator Free MD5 hash generator: turn any text or file into an MD5 checksum in your browser - useful for integrity checks and quick fingerprinting.
Base64 Encoder & Decoder Free Base64 encoder and decoder: convert text or files to Base64 and back, entirely in your browser - nothing is uploaded to a server.
JWT Decoder Free JWT decoder: paste a token to read its header, payload and signature in a readable form - decoding happens in your browser, nothing is sent.
URL Encoder & Decoder Free URL encoder and decoder: convert links and query parameters to percent-encoding and back, with full-URL and component modes, in your browser.
UUID Generator Free UUID generator: create v1, v4 and v5 identifiers instantly, generate them in bulk and copy any value with a single click - no signup needed.

Other Tools You May Like

Word to PDF Convert Word to PDF for free: upload a DOC, DOCX, ODT or RTF file and download a properly formatted PDF in seconds - no registration or watermark.
PDF to Word Convert PDF to Word for free: upload a PDF and download an editable DOCX in seconds - no registration, no watermark and nothing to install.
Word Counter Free word counter: paste any text to count words, characters, sentences and paragraphs, and see the estimated reading time - nothing leaves your browser.
Character Counter Free character counter: count characters with and without spaces, plus words and lines, and check SEO limits for titles and meta descriptions.
Keyword Density Checker Free keyword density checker: paste text or a URL to see how often each word and phrase appears, with percentages for one, two and three-word terms.