Developer Utilities · Free tool
Subnet / CIDR Calculator
Calculate IPv4 subnets from CIDR or dotted mask: network, broadcast, host range, usable hosts, wildcard, binary. Free, browser-only.
Network
192.168.1.0/24
Class C (legacy) · private
Network address
192.168.1.0
Broadcast address
192.168.1.255
First usable host
192.168.1.1
Last usable host
192.168.1.254
Subnet mask
255.255.255.0
Wildcard mask
0.0.0.255
Total addresses
256
Usable hosts
254
Show binary representation
Network:11000000.10101000.00000001.00000000
Netmask:11111111.11111111.11111111.00000000
Advertisement
What it does
A subnet calculator turns an IP + prefix into the network address, broadcast, host range, mask, and host count. The math is mechanical — every network engineer can do it on paper — but doing it 30 times a day during firewall config or VPN routing eats time. This tool is the calculator next to your terminal.
Accepts CIDR (192.168.1.0/24), IP + dotted mask (10.0.0.0 255.255.0.0), or a bare IP (treated as /32 host route). Computes everything in your browser via plain JavaScript bitwise operations on 32-bit unsigned integers — no library, no server call, no analytics. Recognizes RFC 1918 private ranges, RFC 5737 documentation ranges, RFC 3927 link-local, classful legacy info, plus the /31 point-to-point convention from RFC 3021 and the /32 host-route case.
Embed this tool on your siteShow snippetHide
Paste this snippet into any page. Loads on-demand (lazy), no tracking scripts, and sized to most dashboards. Replace the height to fit your layout.
<iframe src="https://freetoolarena.com/embed/subnet-calculator" width="100%" height="720" frameborder="0" loading="lazy" title="Subnet / CIDR Calculator" style="border:1px solid #e2e8f0;border-radius:12px;max-width:720px;"></iframe>Example input & output
Input
192.168.1.50/26Output
Network: 192.168.1.0
Broadcast: 192.168.1.63
First host: 192.168.1.1
Last host: 192.168.1.62
Subnet mask: 255.255.255.192
Usable hosts: 62The host bits in the input (192.168.1.50) get cleared to find the network address. /26 = 6 host bits = 64 addresses, 62 usable.
How to use it
- Enter an IP and prefix (e.g. 192.168.1.0/24) or click a preset.
- Read off the network address, broadcast, host range, and mask.
- Click Copy on any field to copy that value to your clipboard.
- Expand 'Show binary representation' if you need to see the bit-level layout.
How it works
Three core bitwise operations, all done on unsigned 32-bit integers:
- Network address:
ip AND netmask— the host bits get zeroed out. - Broadcast address:
network OR wildcard— the host bits get set to all-ones. - Wildcard mask:
NOT netmask— the inverted mask, used in ACLs and OSPF.
Special cases: /31 is a point-to-point link (RFC 3021) where both addresses are usable hosts and there's no broadcast; /32 is a host route — exactly one address. /0 is the entire IPv4 space.
When to use this tool
- Configuring firewall rules: you have an IP and need to allow / deny the whole subnet.
- Setting up VPN routes: convert a CIDR to its mask form (or vice versa) for OS routing tables.
- Designing a new VLAN / subnet: figure out how many hosts a /28 vs /27 vs /26 actually buys you.
- Troubleshooting reachability: 'is 10.5.7.42 part of 10.5.0.0/16?' — yes; the network address resolves to 10.5.0.0 either way.
When not to use it
- IPv6 addresses — this is IPv4-only. Use a dedicated IPv6 calculator for /64 / /48 / /128 work.
- Variable-Length Subnet Masking design tables — this calculates one subnet at a time, not a hierarchical division.
Frequently asked questions
- What's the difference between /24 and 255.255.255.0?
- Same thing, two notations. /24 means '24 leading 1 bits in the mask' which translates to 11111111.11111111.11111111.00000000 = 255.255.255.0. CIDR notation is just a more compact way to write masks.
- Why /31 only has 2 hosts (not 0)?
- RFC 3021 (2000) redefined /31 for point-to-point links. Both addresses are usable hosts; there's no separate network or broadcast. Useful for router-to-router links because /30 wastes 2 of every 4 addresses on network + broadcast.
- Is 192.168.1.0 always a network address?
- Only when paired with a mask of /24 or wider. 192.168.1.0/25 has TWO subnets: 192.168.1.0/25 (first half) and 192.168.1.128/25 (second half). Always check the prefix.
- What's a wildcard mask vs subnet mask?
- Inverted bits. Subnet mask 255.255.255.0 = wildcard 0.0.0.255. Cisco ACLs and OSPF use wildcard form; routing tables use subnet form. Same information, different convention.
- Does this support IPv6?
- No — IPv4 only. IPv6 has different mechanics (no broadcast, /64 default for LANs, hex notation) so it deserves a dedicated tool.
Advertisement
Learn more
Guides about this topic
- Using Our Tools · GuideHow to generate QR codesMake a QR code for a URL, wifi, vCard, or plain text. What error-correction means, how big to print, how to test it.
- Using Our Tools · GuideHow to create a strong passwordThe entropy math, 2026 NIST rules, passphrases vs passwords, password managers, MFA and hardware keys, where passkeys fit, 5 mistakes that still lose accounts
- Developers & Technical · GuideHow to encode and decode Base64What Base64 is (not encryption), the 3-to-4 encoding mechanics, standard vs URL-safe vs MIME variants, 33% overhead, when to use it, common mistakes
- Design & Media · GuideHow to choose a color paletteHSL color theory, four palette schemes (monochromatic, analogous, complementary, triadic), the 60-30-10 rule, WCAG contrast, dark mode, and palette tools.
- Developers & Technical · GuideHow to use JWT tokens securelyJWT anatomy, HS256 vs RS256, the 'alg: none' attack, expiration strategy, storage (localStorage vs httpOnly cookies), revocation patterns, and claim validation.
- Design & Media · GuideHow to design a faviconThe sizes you actually need in 2026, design principles that survive 16×16 rendering, dark mode support, the HTML tags, web manifest, and testing.
Explore more developer utilities tools
- Port Number LookupQuick reference for ~140 well-known TCP/UDP ports — search by number or service name. Web, mail, DNS, DB, SSH, Docker, Kafka, MQTT, more.
- Test Credit Card NumbersReference table of canonical test card numbers from Stripe, Adyen, and Braintree sandbox docs. Plus Luhn validator + network detector.
- IPv6 Expander & ShortenerExpand or shorten IPv6 addresses to RFC 5952 canonical form. Handles zone IDs, prefix length, embedded IPv4, ip6.arpa reverse DNS, and binary.
- Htpasswd GeneratorGenerate .htpasswd lines for Apache + nginx Basic Auth. Browser-only SHA hashing. Includes nginx + Apache config snippets and curl example.
- Chmod CalculatorCalculate Unix file permissions: octal (755, 644) ↔ symbolic (rwxr-xr-x) ↔ rwx checkboxes. Covers setuid, setgid, sticky bit. With presets.
- Excel Formula ExplainerPaste an Excel or Google Sheets formula, get a plain-English breakdown of every function. Covers 60+ functions, gotchas, modern alternatives.