CIDR ↔ IP Range / Netmask Converter
Convert in every direction between CIDR notation, IP range (start–end), netmask (dotted decimal), and wildcard mask. Decompose any IP range into the minimal exact set of CIDR blocks. Supports both IPv4 and IPv6 with batch conversion of many CIDRs or ranges. 100% client-side.
About CIDR ↔ IP Range / Netmask Converter
Convert in every direction between CIDR notation, IP range (start–end), netmask (dotted decimal), and wildcard mask. Decompose any IP range into the minimal exact set of CIDR blocks. Supports both IPv4 and IPv6 with batch conversion of many CIDRs or ranges. 100% client-side. Everything runs locally in your browser — your data never leaves your device.
How to use
- Enter your input in the tool above.
- Adjust any options to your preference.
- Use the Copy or Download buttons to save the result.
- Everything happens locally — your data never leaves your browser.
FAQ
How does the CIDR ↔ range / netmask converter work?
Pick a family (IPv4 or IPv6) and enter any one of the three synced inputs — a CIDR block (192.168.100.0/22), a start–end range (192.168.100.0–192.168.103.255), or a netmask (255.255.252.0). The tool computes the other two instantly. CIDR → range uses 32-bit (IPv4) or 128-bit BigInt (IPv6) mask math. Range → CIDR runs the standard greedy algorithm that emits the provably minimal exact list of CIDR blocks covering the range. Mask ↔ CIDR validates the mask is contiguous (all ones then all zeros) and converts to the equivalent prefix length.
How does range → CIDR decomposition produce the minimal set?
Given a start and end IP, the algorithm repeatedly emits the largest CIDR block that (a) starts at the current cursor, (b) is aligned to its own size, and (c) does not overshoot the end. This is the well-known greedy range-to-CIDR algorithm and provably produces the smallest possible number of blocks. For example, 192.168.100.0–192.168.103.255 collapses to a single 192.168.100.0/22, while 10.0.0.0–10.0.0.5 expands to /32 and /31 and /30 blocks. The total block count is shown for verification.
What is a wildcard mask and how does it relate to the netmask?
The wildcard mask (also called the inverse mask) is the bitwise NOT of the subnet mask. For a /24 IPv4 prefix, the netmask is 255.255.255.0 and the wildcard is 0.0.0.255. Wildcard masks are commonly used in Cisco ACLs. The tool computes both, plus the host count (2^(32−cidr) − 2 for /0–/30, 2 for /31 (RFC 3021), 1 for /32) and the total address count, and for IPv6 the total address count is BigInt-exact.
Can I convert many CIDRs or ranges at once?
Yes. Use the Batch tab and paste one entry per line. Each line may be a CIDR (192.168.0.0/24), a range (192.168.0.0–192.168.0.255 or 192.168.0.0 - 192.168.0.255), or a bare IP (treated as /32 IPv4 or /128 IPv6). The tool auto-detects IPv4 vs IPv6 per line, converts each to its full breakdown, and produces a combined CSV/JSON export plus a consolidated CIDR list.
What extra features does this converter have versus others?
(1) Bidirectional CIDR ↔ range ↔ mask ↔ wildcard in one view. (2) Both IPv4 (32-bit) and IPv6 (128-bit BigInt). (3) Range → minimal exact CIDR set via greedy algorithm. (4) Wildcard mask computed alongside netmask. (5) Host count (RFC 3021 aware) and total address count. (6) Batch mode with per-line family auto-detection. (7) Netmask equivalence reference table (CIDR, mask, wildcard, hosts, total). (8) Mask validation — rejects non-contiguous masks with a clear message. (9) CSV and JSON export. (10) History (localStorage, last 20). (11) Shareable URL with full state encoded. 100% client-side, no ads, no uploads.
Related tools
.bashrc / .zshrc Alias & Config Manager
Build shell aliases, functions, exports, and PATH edits in a visual editor, then export a clean, commented .aliases file sourced from both .bashrc and .zshrc — with shadowing detection against shell builtins and common CLI tools, function suggestions when args are needed, starter packs (git, docker, kubectl, navigation, safety, ls, dev, devops, data science), import of existing rc files, dedupe, history (localStorage), and shareable URL. 100% client-side.
Add / Subtract Date Calculator
Add or subtract years, months, weeks, days, hours, minutes and seconds from a starting date/time. Calendar-day or business-day mode with custom weekend + holiday list. Month-end policy toggle (clamp to last day vs overflow). Repeat/series mode (e.g. every 2 weeks x 10) with CSV export. Shareable URL. 100% client-side.
Age Calculator
Calculate exact age from a birth date in calendar years/months/days (no negative-day bugs) plus totals in months/weeks/days/hours/minutes/seconds. Next-birthday countdown with weekday. Feb-29 birthday policy toggle. Milestones (1,000 days, 10,000 days, 1 billion seconds). Zodiac sign + Chinese zodiac. Age gap comparison. Shareable URL. 100% client-side.