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 QR codes for URLs, WiFi, vCard, or text. Learn error correction and sizing, then generate your QR code online free with no sign-up in seconds.
- Using Our Tools · GuideHow to create a strong passwordGenerate a strong password instantly online for free. Build high-entropy passphrases following NIST 2026 rules with no download needed.
- Developers & Technical · GuideHow to encode and decode Base64Understand the 3-to-4 mechanic and 33% overhead for standard, URL-safe, and MIME Base64. Free online reference to avoid common mistakes, no download needed.
- Design & Media · GuideHow to choose a color paletteBuild accessible color palettes using HSL theory, monochromatic to triadic schemes, WCAG contrast checks, and dark mode tips. Free, no-download guide.
- Developers & Technical · GuideHow to use JWT tokens securelyImplement secure JWT authentication by choosing RS256, setting expiration, using httpOnly cookies, and preventing 'alg: none' attacks in your browser for free.
- Design & Media · GuideHow to design a faviconCreate favicons that render perfectly from 16×16 to 512×512 with dark mode support. Learn the right HTML tags and web manifest setup free online.
Explore more developer utilities tools
- Port Number LookupSearch over 140 well-known TCP and UDP ports by number or service name. Free online reference tool with no sign-up, covering web, mail, DNS, and 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 & ShortenerFormat IPv6 addresses to canonical form, handling zone IDs and prefixes, instantly online—free tool with no registration required.
- Htpasswd GeneratorCreate .htpasswd lines for Apache or nginx basic auth with browser-only SHA hashing instantly. Includes config snippets and a free online tool with no registration.
- Chmod CalculatorCalculate Unix file permissions: octal (755, 644) ↔ symbolic (rwxr-xr-x) ↔ rwx checkboxes. Covers setuid, setgid, sticky bit. With presets.
- Excel Formula ExplainerPaste any formula and get a plain-English breakdown of 60+ functions online free—no sign-up required, in your browser.