CIDR calculator

Examples:

Addresses

Transparency

Everything is computed in your browser, by the scripts listed below. What you type never leaves this page.

Enforced by your browser
This page's Content Security Policy forbids any network request and any form submission (connect-src 'none'; form-action 'none'). You can read the policy at the top of the page source.
What is stored
No cookie, and nothing in the address. What you type is not kept. Only your language choice, if you make one, is kept in this tab's sessionStorage until you close it. Like any website, the server records the download of the page and its files in its access logs (IP address, date and time, address requested, browser name). It never receives what you type.
Code that runs here
  • app.js: the calculator, written for R-no Toolbox. Not minified, no third-party library. IPv4 and IPv6 use the same arithmetic on 32- and 128-bit integers (BigInt). 12.8 kB
    SHA-256 46c1d265c68051a0f0ab54d71a013dd31f2ce8b8677bbbf9da2c2b701a7993f4
  • textes.js: the French text of this page. It only defines texts, with no logic. 5.0 kB
    SHA-256 776ab77a3800f9dacdbdf6deb3ff726d87887b9cf4afb6558b9d612c22d77c87
  • /commun/langue.js: the language switcher, the same on every page of the site. It reads and writes only the language choice. 5.7 kB
    SHA-256 a41e6774538ae00aa6535d4ac2e7b482dd9134c7dcd2e0d9a1bf41b35b673ae7
Tested
The arithmetic is covered by automated tests, run on every deployment: /31 and /32 ranges, /0, IPv6 compression (RFC 5952), IPv4 inside IPv6, and the rejection of malformed input.
Check it yourself
Download a script and compare its fingerprint with the one above:
curl -s https://r-no.fr/ip/cidr/app.js | shasum -a 256
Limits
The full list is shown up to 65,536 addresses (an IPv4 /16, an IPv6 /112). In IPv4, the first and last addresses of a range up to /30 are counted as network and broadcast, and are not usable by hosts; /31 and /32 follow RFC 3021. IPv6 has no broadcast. The range type comes from the usual IANA special-purpose registries, not from a live lookup.
Source repository
The R-no Toolbox repository is private. The files listed above are the complete tool, exactly as your browser runs it.