IPv4 Subnet Calculator
Enter a CIDR like 192.168.1.0/24 to get network and broadcast addresses, mask, wildcard, host range, usable host count, IP class and private-range flag.
For /31 and /32 subnets every address is usable (RFC 3021 point-to-point and single-host routes). Classful A/B/C/D/E is shown for reference only — modern routing is classless.
This tool runs entirely in your browser. Your data never leaves your device — it is not uploaded to any server.
How to use
- 1Type a CIDR like 10.0.0.0/8 or 192.168.1.130/26 — a bare IP is treated as /32.
- 2Read network, broadcast, mask, wildcard, host range and counts from the result cards; key values have one-click copy.
- 3Switch to the smallest-covering-CIDR tab and enter two IPs to get the minimal block containing both.
IPv4 Subnet Calculator
Sizing a network, writing a firewall rule or summarizing routes all start from the same handful of values: where the network begins, where it ends, which mask expresses it and how many hosts actually fit. Type a CIDR (or a bare IP, treated as /32) and every value appears at once — network and broadcast addresses, dotted subnet mask, wildcard mask for ACL syntax, first and last usable host, total and usable counts, the classful letter and whether the range is private (RFC 1918, loopback, link-local or CGNAT).
A second mode answers a different question: given two IP addresses, what is the smallest single CIDR block that contains both? That is exactly what you need when merging two hosts into one firewall rule or summarizing a route, and doing it by hand is surprisingly error-prone.
All values follow standard CIDR math: the mask is n prefix bits followed by zeros, the network address zeroes the host bits, broadcast sets them all, and usable hosts are 2^(32−n) − 2 because the network and broadcast addresses are reserved. /31 and /32 follow their RFC 3021 and host-route exceptions.
Compared with doing this by hand, the containment mode answers the summarize-two-IPs question directly, and the private-range flags — RFC 1918, loopback 127/8, link-local 169.254/16, CGNAT 100.64/10 — prevent the classic firewall mistake of allowing a range you thought was public. Everything computes locally, which is safe for internal addressing plans.
Frequently asked questions
Why does /31 report all addresses as usable?
RFC 3021 defines /31 subnets for point-to-point links where neither a network nor a broadcast address is reserved, so both addresses are usable. /32 is a single-host route with one address by definition. The classical "minus two" rule only applies from /30 upward.
What are the private ranges the tool checks?
RFC 1918 private space (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16), loopback (127.0.0.0/8), IPv4 link-local (169.254.0.0/16) and the CGNAT shared address space (100.64.0.0/10). Addresses outside these are flagged as public.
Are IP classes still meaningful?
Not for routing — the internet moved to classless CIDR decades ago. The A/B/C/D/E letter is shown only for reference, because legacy documentation, exam questions and some old devices still speak in classful terms.
How is the smallest covering CIDR computed?
The two addresses are XORed to find which low-order bits differ; the prefix is the first bit position where they agree, and the block is aligned down to that boundary. For example 10.1.2.3 and 10.1.9.200 fall together into 10.1.0.0/20.
How accurate are the results?
Calculations follow the official definitions — SI conversion factors, NIST constants, or the governing formula shown on the page — and results display to enough significant digits for real-world use.
Can I use it on mobile?
Yes. The interface is responsive and all inputs adapt to touch; the calculation itself runs offline once loaded.
Related tools
IP Lookup
Find any IP address's country, city, ISP and ASN in seconds — or check your own IP — with a free keyless API, right in your browser.
DNS Lookup
Look up A, AAAA, MX, TXT, NS and CNAME records for any domain via DNS-over-HTTPS in a clean table — no terminal or dig commands needed.
WHOIS Lookup
Check domain registration data via RDAP — registrar, creation and expiry dates, status codes and nameservers — with clear notes on TLD coverage.
Binary Converter
Convert between decimal, hexadecimal, octal and binary in one live grid — supports arbitrarily large integers, grouping for readability.
Unix Timestamp Converter
Convert Unix seconds or milliseconds to human dates and back, with a live clock, local-timezone and UTC output — all in your browser.
Hash Generator
Compute SHA-1, SHA-256, SHA-384, SHA-512 or MD5 hashes of text or files, right in your browser. Fast checksums for integrity checks — nothing uploaded.
Embed this tool
Put this tool on your own site with one line — it runs entirely in the visitor's browser.
<iframe src="https://zoyku.com/en/tools/ipv4-subnet-calculator?embed=1" width="100%" height="640" style="border:0;border-radius:16px" title="Zoyku — ipv4-subnet-calculator" loading="lazy"></iframe>