IP Calculator — Free Online Subnet, CIDR & Network Calculator
Free IP calculator and subnet calculator for IPv4 and IPv6. Enter any IP address and CIDR to instantly calculate network address, broadcast, subnet mask, wildcard mask, and usable hosts. Includes VLSM, subnet splitter, IP range converter, and a full subnet cheat sheet. 100% client-side — your data never leaves your browser.
What it does
Full IPv4 subnet breakdown
Enter any IP address in CIDR, IP+mask, or host-in-subnet notation. Instantly get network address, broadcast address, subnet mask, wildcard mask, usable host range, total addresses, IP class, network type (RFC 1918 private, loopback, APIPA, CGNAT, multicast), binary mask, hex IP, integer IP, and reverse DNS.
IPv6 subnet calculator
Full IPv6 support using native BigInt. Enter any /0–/128 prefix and get the full and compressed address forms, first/last address, total addresses (exact, as a number up to 2¹²⁸), address type (global unicast, link-local, ULA, multicast, loopback, documentation, NAT64), and reverse DNS arpa notation.
Visual binary subnet calculator
See your subnet as 32 coloured bit squares — network bits in blue, host bits in green. A draggable slider between the two halves adjusts the CIDR prefix live. Dotted-decimal and binary representations update simultaneously as you drag. Perfect for understanding subnetting intuitively.
VLSM calculator
Variable Length Subnet Masking: enter a base CIDR and a list of required host counts. The tool allocates the most efficient subnets (largest first) with zero wasted space, outputting a table of network, broadcast, usable range, and prefix for each block. Export as CSV.
Subnet splitter & supernet aggregator
Split any parent CIDR into N equal child subnets, or aggregate 2+ adjacent CIDRs into their smallest containing supernet. The range-to-CIDR converter finds the minimal set of CIDR blocks covering any arbitrary IP range.
Subnet cheat sheet (/0–/32)
A permanent reference table covering every IPv4 prefix length: CIDR, subnet mask, wildcard mask, total hosts, usable hosts, and IP class. Every row is clickable and populates the calculator. Download the full table as a PDF for offline reference.
Shareable calculations via URL
Every calculation is encoded into the page URL (?ip=&mask=&mode=) so you can bookmark or share a link and anyone can reproduce your exact result. No account or login required.
Zero dependencies, works offline
All calculation logic is implemented from scratch in TypeScript bitwise math and native BigInt for IPv6. No external libraries, no tracking, no server calls. The tool works entirely in your browser and continues to function after the first load even without internet.
How to use IP Calculator — Free Online Subnet, CIDR & Network Calculator
- 1Enter an IP address or CIDR
Type any IPv4 or IPv6 address in the main input box. Accepted formats: 192.168.1.0/24 (CIDR), 192.168.1.0 255.255.255.0 (IP + dotted mask), 192.168.1.100/24 (host address — the tool finds the parent network), 192.168.1.10-192.168.1.200 (IP range), 2001:db8::/32 (IPv6 CIDR). Or click one of the preset chips.
- 2Read the results panel
Results appear instantly as you type (debounced at 100 ms). The panel shows all 18 IPv4 fields: IP address, network address, broadcast address, subnet mask, CIDR notation, wildcard mask, netmask, usable host range, first/last usable IP, total addresses, usable hosts, IP class, network type, binary subnet mask, binary IP, hex IP, integer IP, and reverse DNS. Each field has a copy-to-clipboard button.
- 3Copy individual fields or the full result
Click the copy icon next to any field to copy just that value. Click "Copy All as JSON" at the top of the results panel to copy the entire result as a structured JSON object — useful for pasting into documentation or automation scripts.
- 4Use advanced mode tabs for VLSM, splitting, and range conversion
Click the tabs at the top of the tool to switch modes: VLSM (Variable Length Subnet Masking), Subnet Splitter (divide a network), Range↔CIDR (convert between IP ranges and CIDR blocks), In Subnet? (check if an IP belongs to a network), Supernet (aggregate CIDRs). The ?mode= query param is updated so you can share a link to the specific mode.
- 5Share or bookmark your calculation
Click the "Share" button to copy the current page URL with all inputs encoded as query parameters. Any recipient can open the link and see the same result. Alternatively, bookmark the URL directly in your browser.
When to use this
Network engineers designing subnets
Planning a /22 allocation for a new office segment: enter 10.10.0.0/22 to confirm usable hosts (1022), broadcast address (10.10.3.255), and ensure the range does not overlap with existing subnets. Use the VLSM tab to allocate host-count-appropriate sub-blocks.
Cloud infrastructure engineers (AWS, Azure, GCP)
Setting up an AWS VPC: enter 10.0.0.0/16 to understand the available space (65,534 IPs), then split into /24 subnets per availability zone. The tool shows the AWS-specific note that 5 IPs per subnet are reserved, so a /24 has 251 usable hosts.
Students learning for CCNA or Network+ certification
Practising subnetting: use the visual binary calculator to understand which bits are network vs host, drag the prefix slider from /24 to /26 and see the subnets change in real-time, then verify against the subnet cheat sheet.
Security engineers writing Cisco ACLs
Cisco access control lists use wildcard masks (the inverse of subnet masks). Enter 172.16.0.0/12 and read the wildcard mask field (0.15.255.255) directly — no manual bit-flip arithmetic needed.
DevOps and SRE teams writing firewall rules
Checking whether a reported IP (203.0.113.100) falls within an expected range: use the "Is IP in Subnet?" tab to confirm membership, see the binary AND operation, and copy the result for runbook documentation.
Common errors & fixes
- "256.1.1.1" — Invalid IPv4 address
- Each octet in an IPv4 address must be 0–255. Check for typos — 256 is one above the maximum.
- "192.168.1" — Incomplete IPv4 address
- IPv4 addresses have exactly four octets separated by dots. The input "192.168.1" is missing the fourth octet. Try "192.168.1.0" or "192.168.1.0/24".
- "192.168.1.0/33" — Prefix out of range
- IPv4 CIDR prefix lengths must be 0–32. /33 is out of range. For a single host, use /32.
- "::g" — Invalid IPv6 character
- IPv6 addresses use only hex digits (0–9 and a–f). The letter "g" is not valid. Check for OCR errors or typos.
- Subnet mask shows "Not a valid subnet mask"
- A valid subnet mask is a contiguous sequence of 1-bits followed by 0-bits. Values like 255.255.254.128 (non-contiguous 1-bits) are not valid. Verify the mask from your device or use CIDR notation instead.
- Usable hosts shows 0 for a /31 subnet
- By default, a /31 subnet (2 total addresses) has 0 usable hosts under classic IPv4 rules because both addresses would be network and broadcast. However, RFC 3021 defines /31 as a valid point-to-point link where both addresses are usable — this calculator correctly shows 2 usable hosts for /31.
Technical details
| IPv4 calculation | Pure bitwise arithmetic — no external library |
| IPv6 calculation | Native BigInt (no bignumber.js or similar) |
| Edge cases | /0, /31 (RFC 3021), /32, /128 all handled correctly |
| Network type detection | RFC 1918, 3927, 5735, 6598 (CGNAT), 5771 (multicast) |
| State persistence | URL query params (?ip=&mask=&mode=) for shareable links |
| Bundle size | < 30 KB gzipped — zero runtime calculation dependencies |
| Privacy | No server calls, no tracking, no cookies for calculation data |
| Offline support | Fully functional after first page load |
Why "IP calculator" is the right keyword — not "subnet calculator"
Search volume data shows "ip calculator" and "ip subnet calculator" receive roughly 5× more queries than "cidr calculator" and 3× more than "subnet calculator" alone. This is counterintuitive to network engineers who think about their work in terms of subnetting, but it reflects how end-users phrase the question: they know they have an IP address and want to calculate something about it.
The implication is significant for how you should name and describe network calculation tools. Leading with "IP" in the title, H1, and URL captures the majority of the search volume, while the body content and H2 sections can cover "subnet", "CIDR", "netmask", and "wildcard mask" to capture secondary clusters.
The fastest-growing queries are in the long tail: "netmask calculator" (+50% YoY), "wildcard mask calculator" (+40%), "subnet chart" (+30%), "visual subnet calculator" (+20%), and the breakout term "subnet calc" (+200%). These rising terms share a common thread — they represent searchers who already understand basic subnetting and want a specific tool for a specific format or visual learning aid. Capturing them means going deeper than a basic calculator.
CIDR notation explained — why /24 means 256 addresses
CIDR (Classless Inter-Domain Routing) notation is a compact way to express an IP address and its associated routing prefix. A "/24" suffix means the first 24 bits of the 32-bit IPv4 address are the "network" portion — shared by all hosts on that segment — and the remaining 8 bits identify individual hosts.
Since 8 host bits can represent 2⁸ = 256 unique values (0–255), a /24 network contains 256 total addresses. The first address (all host bits zero) is the network address — it identifies the network itself and cannot be assigned to a host. The last address (all host bits one) is the broadcast address — sending to it reaches all hosts on the segment simultaneously. The 254 addresses between them are usable for hosts.
This 2^n counting only applies cleanly for /0 through /30. For /31 (RFC 3021, point-to-point links), both addresses are usable — there is no need for a broadcast on a two-node link. For /32, the address is a single host route, used in loopback interfaces and some routing protocols. Understanding these edge cases is essential for CCNA certification and real-world network design.
Wildcard masks — the inverse of subnet masks and why Cisco uses them
A wildcard mask is the bitwise complement of a subnet mask: where the subnet mask has a 1-bit, the wildcard mask has a 0-bit, and vice versa. For a /24 subnet with mask 255.255.255.0, the wildcard mask is 0.0.0.255.
Wildcard masks are used extensively in Cisco IOS access control lists (ACLs) and OSPF configurations. In an ACL, a 0-bit in the wildcard mask means "this bit must match" and a 1-bit means "I don't care about this bit." So a wildcard of 0.0.0.255 applied to 192.168.1.0 matches any IP in 192.168.1.0/24. This logic is the reverse of subnet masking, which trips up many engineers.
Wildcard masks can also be non-contiguous, unlike subnet masks. A wildcard of 0.0.255.0 applied to 192.168.0.0 matches 192.168.x.0 for any value of x — useful for matching all networks in a specific octet pattern. Non-contiguous wildcards are not representable in CIDR notation, which is why CIDR and wildcard masks serve different purposes despite being mathematically related.
What is VLSM and why it replaced classful addressing
Variable Length Subnet Masking (VLSM) allows different parts of a network to use different subnet mask lengths — in contrast to classful addressing, where every subnet in a network used the same mask. VLSM was standardised in RFC 1009 (1987) and became the foundation of modern IP address management.
The classic problem VLSM solves: you have a /24 address block (254 usable hosts) and need to provision subnets of very different sizes — a server farm needing 100 IPs, three branch offices needing 20 IPs each, and four point-to-point WAN links needing only 2 IPs each. With a single fixed mask, you waste enormous numbers of addresses. With VLSM, you allocate /25 for the server farm (126 hosts), /27 for each branch (30 hosts), and /30 for each WAN link (2 hosts) — fitting all requirements with minimal waste.
The VLSM calculator on this page implements the optimal allocation algorithm: sort required subnets from largest to smallest, then allocate from the start of the available block. This greedy approach minimises fragmentation and is the same method taught in CCNA and Network+ curricula.
IPv4 address exhaustion and the role of private address ranges
IPv4 uses 32-bit addresses, allowing a theoretical maximum of 4,294,967,296 unique addresses. In the early internet, this seemed vastly more than needed — but exponential growth in connected devices made exhaustion inevitable. IANA allocated the last block of IPv4 addresses to regional registries in 2011.
The primary mechanism that delayed exhaustion by decades was Network Address Translation (NAT), enabled by the three private address ranges defined in RFC 1918: 10.0.0.0/8 (16.7 million addresses), 172.16.0.0/12 (1 million addresses), and 192.168.0.0/16 (65,536 addresses). These ranges are not routed on the public internet — every home router, corporate network, and cloud VPC uses them internally, with NAT translating to a single public IP at the boundary.
A fourth range worth knowing is the CGNAT range 100.64.0.0/10 (RFC 6598), used by internet service providers to extend NAT one level higher — multiple customers share a single public IP through carrier-grade NAT. This is why your home router might itself be behind NAT, with an IP in the 100.64.0.0/10 range from your ISP rather than a true public IP.
Frequently Asked Questions
What is an IP calculator?
- An IP calculator (also called a subnet calculator or CIDR calculator) is a tool that takes an IP address and subnet mask or CIDR prefix and computes all associated network parameters: network address, broadcast address, usable host range, total addresses, subnet mask, wildcard mask, and binary representations. This calculator also supports IPv6, VLSM, subnet splitting, range-to-CIDR conversion, and generates a full subnet cheat sheet.
What is the difference between a subnet calculator and a CIDR calculator?
- They describe the same operation from different angles. A subnet calculator focuses on dividing an IP space into segments and computing their properties. A CIDR calculator focuses on the notation — expressing a network as a base address plus a prefix length (e.g., 192.168.1.0/24). In practice, every CIDR calculator is also a subnet calculator. This tool handles both, as well as dotted-decimal mask input (e.g., 255.255.255.0).
How do I calculate the number of usable hosts in a subnet?
- The formula is 2ⁿ − 2, where n is the number of host bits (32 minus the prefix length for IPv4). For a /24, host bits = 8, so 2⁸ − 2 = 254 usable hosts. The subtraction of 2 accounts for the network address (all host bits zero) and the broadcast address (all host bits one), which cannot be assigned to devices. Exceptions: /31 networks (RFC 3021) have 2 usable hosts and no broadcast, used for point-to-point links; /32 networks have exactly 1 usable "host" — the address itself, used for loopback interfaces and host routes.
What is a subnet mask?
- A subnet mask is a 32-bit number (for IPv4) that divides an IP address into a network portion and a host portion. It consists of a contiguous block of 1-bits (the network part) followed by 0-bits (the host part). For example, 255.255.255.0 in binary is 11111111.11111111.11111111.00000000 — the first 24 bits identify the network, the last 8 bits identify the host. Performing a bitwise AND between the IP address and the subnet mask yields the network address.
What is CIDR notation and why is it used?
- CIDR (Classless Inter-Domain Routing) notation expresses a network as an IP address followed by a slash and the number of network bits — e.g., 192.168.1.0/24. It replaced the original classful addressing system (Class A/B/C) in 1993, allowing arbitrary prefix lengths instead of fixed 8/16/24-bit boundaries. CIDR enables more efficient allocation of IP space and is the standard notation in routing protocols (BGP, OSPF), cloud VPC configuration, and firewall rules.
What is a wildcard mask and when is it used?
- A wildcard mask is the bitwise inverse of a subnet mask — 0-bits mean "this bit must match" and 1-bits mean "any value is accepted." They are used in Cisco IOS access control lists (ACLs) and OSPF area configuration. For example, to permit all traffic from 192.168.1.0/24 in a Cisco ACL, you write: permit 192.168.1.0 0.0.0.255 — where 0.0.0.255 is the wildcard. This is the inverse of the subnet mask 255.255.255.0.
What is a netmask? Is it the same as a subnet mask?
- Yes — "netmask" and "subnet mask" refer to the same thing. "Netmask" is the older Unix/Linux terminology (used in ifconfig, /etc/network/interfaces, and similar tools), while "subnet mask" is more common in Cisco and vendor-neutral documentation. Both are 32-bit values (e.g., 255.255.255.0) that define the network boundary. The term "netmask calculator" is more common in Linux/DevOps contexts, while "subnet mask calculator" is more common in networking certification contexts.
What are the private IP address ranges?
- RFC 1918 defines three private IPv4 ranges: 10.0.0.0/8 (10.0.0.0–10.255.255.255, ~16.7 million addresses), 172.16.0.0/12 (172.16.0.0–172.31.255.255, ~1 million addresses), and 192.168.0.0/16 (192.168.0.0–192.168.255.255, 65,536 addresses). These are not routed on the public internet. Additionally, 127.0.0.0/8 is loopback, 169.254.0.0/16 is link-local (APIPA), and 100.64.0.0/10 is CGNAT (RFC 6598, used by ISPs).
How does IPv6 subnetting differ from IPv4?
- IPv6 uses 128-bit addresses, giving 2¹²⁸ ≈ 340 undecillion total addresses. The notation is the same CIDR format (e.g., 2001:db8::/32). A typical IPv6 allocation to an organisation is a /48 (leaving 16 bits for subnets and 64 bits for hosts — giving 65,536 subnets each with 2⁶⁴ hosts). Within a site, subnets are almost always /64. Unlike IPv4, there is no concept of "wasting" addresses, and subnet masks in dotted-decimal form do not exist — only CIDR prefix notation is used.
Can I use /31 and /32 subnets?
- Yes. /32 is a host route — it identifies a single IP address, used for loopback interfaces, VPN virtual addresses, and policy routing. /31 subnets are defined by RFC 3021 for point-to-point links: with only 2 addresses in the block, both can be used for devices (no network or broadcast address is needed). /31 subnets are supported by modern routers and switches and save addresses on WAN links and virtual interconnects.
Is my IP data sent to a server when I use this calculator?
- No. All calculations happen entirely in your browser using JavaScript/TypeScript. No IP address, subnet, or any other input is ever transmitted to our servers. This tool has no backend, no analytics that record your inputs, and no cookies used for calculation purposes. It also functions offline after the first page load, since there are no API calls to make.
How accurate is this subnet calculator compared to mxtoolbox or calculator.net?
- This calculator correctly handles all edge cases including /0 (entire IPv4 space), /31 (RFC 3021 point-to-point with 2 usable hosts and no broadcast), /32 (single host route), and IPv6 /128. It classifies network types per RFC 1918, 3927, 5735, and 6598 (CGNAT). It also provides wildcard masks, binary representations, hex/integer IP formats, and reverse DNS — fields not consistently present on most competitors. If you find a discrepancy, please open an issue.
Related Tools
Cron Builder
Visual builder for cron-job schedules.
JWT Decoder
Decode and inspect JWT tokens — header, payload, timestamps.
Hash Generator
Generate MD5, SHA-1, SHA-256, and SHA-512 hashes from text or files. Supports HMAC authentication codes.
Unix Timestamp
Unix timestamps to human dates, multiple timezones.
Regex Tester
Real-time expression matching and testing.