IP / CIDR Calculator
Subnets, masks and IP ranges for IPv4 and IPv6
Calculate network and broadcast addresses, masks, host ranges and counts for any CIDR, and check whether an IP is in a range.
- IP
- CIDR
- Subnet
- IPv6
How to use IP / CIDR Calculator
- Type an address into IP / CIDR: a CIDR such as
192.168.1.10/24or2001:db8::/32, an IPv4 address with a netmask (10.1.2.3 255.255.255.0or10.1.2.3/255.255.255.0), or a bare IP. Press Try IPv6 for an IPv6 example. - Read the network details: network, broadcast, netmask and wildcard (for IPv6, the last address), first and last host, usable hosts and total addresses, the class (IPv4) or compressed and expanded forms (IPv6), plus the binary form with the network bits highlighted, the integer and hex value and the reverse DNS name. Copy CIDR copies the network.
- Check the badge: Public or Special-purpose, with the range’s name and RFC, for example private (RFC 1918), loopback, documentation or multicast.
- Under Is this IP in the range?, enter an IP or CIDR to check to see whether it lies inside the network.
- Use Split into subnets by New prefix or Number of subnets, and Summarise a list of CIDRs to merge a list of CIDRs or IPs (one per line) into the fewest covering blocks.
How it works
Addresses are converted to integers with JavaScript BigInt, so IPv4 (32 bits) and IPv6 (128 bits) use the same exact maths. The network is the address with the host bits cleared by the netmask, and the broadcast or last address has them all set. For IPv4, the network and broadcast addresses don’t count as hosts, except in a /31 (point-to-point, RFC 3021) or /32. IPv6 has no broadcast, so every address in the block is counted.
IPv6 input accepts :: compression, leading zeros, an embedded IPv4 tail (::ffff:192.0.2.1), square brackets and a %zone suffix, which is ignored. Output is the RFC 5952 canonical form, and the expanded form shows all eight groups. The classification picks the most specific matching block from a built-in table of IANA special-purpose ranges; a block that only partly overlaps them is reported as mixed.
Splitting steps through the network in equal blocks. Number of subnets rounds up to the next power of two. Summarising sorts the blocks, merges any that overlap or touch, and writes each merged range as the largest aligned CIDR blocks that cover it exactly.
Limits
- Netmasks are accepted only for IPv4; IPv6 takes a prefix length (0–128). Non-contiguous masks are rejected, and a wildcard mask such as
0.0.0.255is recognised and the matching netmask suggested. - IPv4 must be four dotted decimal numbers from 0 to 255. Shorthand like
10.1and hex or octal parts aren’t accepted, and leading zeros are read as decimal. - A split lists up to 256 subnets on the page; larger splits still show the total count.
- The summary takes lines, commas or semicolons as separators and ignores text after
#. Up to 10 invalid entries are listed. - There is no input for an address range written as start–end, and nothing is looked up on the network: reverse DNS is only the name to query, not its result.
Privacy
All calculations run in your browser, and nothing is uploaded or saved; the site’s Content Security Policy blocks requests to other servers, so no DNS or WHOIS lookups happen. Copy share link puts the address, the IP to check, the split settings and the summary list in the link’s # fragment, which browsers don’t send to servers.
Frequently asked questions
Why does a /24 have 254 usable hosts and not 256?
In IPv4 the first address is the network and the last is the broadcast address, so neither can be given to a host. A /31 and a /32 are the exceptions, where every address counts.
What does “host bits set” mean?
The address you typed isn’t the start of its network, for example 192.168.1.10/24. The tool still calculates the network (192.168.1.0/24) and tells you which one it used.
What is a wildcard mask?
The inverse of the netmask, used by Cisco ACLs and OSPF: 0.0.0.255 for a /24. It is shown for every IPv4 network, and if you type one where a netmask is expected, the tool suggests the matching netmask.
Why does IPv6 show no broadcast address?
IPv6 has no broadcast; it uses multicast instead. The tool shows the Last address of the block, and all addresses count as usable.
How does summarising work?
Overlapping and adjacent blocks are merged, then each merged range is written as the fewest CIDR blocks that cover exactly those addresses. 192.168.0.0/24 and 192.168.1.0/24 become 192.168.0.0/23. IPv4 and IPv6 are summarised separately.
Is the IP class still meaningful?
Classes A to E are historical; routing has used CIDR prefixes since 1993. The class is shown for reference only, and the network is always worked out from the prefix or netmask you enter.
More tools
- Clean Image: Inspect and remove hidden image metadata
- JWT Decoder: Decode and verify JSON Web Tokens
- Diff Checker: Compare two texts line by line
- JS Runner: Run JavaScript and TypeScript in your browser
- JSON Formatter: Format, validate and minify JSON
- Encode / Decode: Base64, URL, HTML entity and hex
- Hash Generator: MD5, SHA and HMAC of any text
- UUID Generator: Generate UUID v4 and v7 in bulk
- Timestamp Converter: Unix time ↔ human dates
- Regex Tester: Test regular expressions live
- URL Parser: Break a URL into its parts
- HTTP Status Codes: Look up any HTTP status code
- MIME Type Lookup: File extension ↔ MIME type
- Password Generator: Strong random passwords and passphrases
- Random String Generator: Random tokens, IDs and keys
- Slug Generator: Turn titles into URL slugs
- Case Converter: camelCase, snake_case, Title Case and more
- Word Counter: Count words, characters and reading time
- JSON to TypeScript: Generate TypeScript types from JSON
- JSON Diff: Compare two JSON documents structurally
- JSON to SQL: Turn JSON arrays into SQL inserts
- YAML ↔ JSON: Convert between YAML and JSON
- XML ↔ JSON: Convert between XML and JSON
- CSV ↔ JSON: Convert between CSV and JSON
- CSV Viewer: View, sort and filter CSV files
- SQL Formatter: Format and beautify SQL queries
- cURL ↔ Fetch: Convert cURL commands to fetch and back
- Markdown Editor: Write Markdown with a live preview
- Text Cleaner: Remove duplicate lines, empty lines and extra spaces
- Find & Replace: Find and replace in any text
- Cron Expression Builder: Build and explain cron schedules
- User-Agent Parser: Identify browser, OS and device from a user agent
- HTTP Headers Inspector: Paste response headers and get them explained
- JWT Generator: Create and sign test JSON Web Tokens
- Certificate Inspector: Decode PEM certificates and keys
- Meta Tag Inspector: Check a page's SEO and social tags
- UTM Builder: Build campaign URLs with UTM parameters
- URL Cleaner: Strip tracking parameters from links
- Robots.txt Generator: Create and test a robots.txt file
- Sitemap Generator: Create an XML sitemap from a list of URLs
- Image Compressor: Shrink JPEG, WebP and AVIF images in your browser
- Image Resizer: Resize images by pixels, percentage or to fit a box
- Image Converter: Convert between PNG, JPEG, WebP and AVIF
- Image to Base64: Encode images as Base64 data URIs and decode them back
- SVG Optimizer: Minify and sanitize SVG files
- Favicon Generator: Make favicon.ico, Apple and Android icons from an image or emoji
- Color Converter: HEX, RGB, HSL, OKLCH and contrast checks
- Number Base Converter: Binary, octal, decimal, hex and float bits
- JSONPath Query: Query JSON with JSONPath expressions
- JSON Schema Validator: Validate JSON against a schema, or generate one
- Semver Checker: Check versions against semver ranges
- chmod Calculator: Unix permissions: rwx ↔ octal
- .env Diff: Compare and validate .env files
- TOTP Generator: Generate and verify 2FA codes
- String Escaper: Escape and unescape strings for any language
- Unicode Inspector: See every character, code point and hidden symbol
- Mock Data Generator: Generate realistic fake data
- QR Code Generator: Create QR codes for links, Wi-Fi and contacts
- Lorem Ipsum Generator: Placeholder text in paragraphs, sentences or words
- Date Calculator: Date differences, business days and durations
- Unit Converter: Convert bytes, lengths, weights, temperatures and more
- Query CSV with SQL: Run SQL queries on CSV files
- PDF Merge & Split: Merge, split, reorder and rotate PDFs
- PDF Metadata Cleaner: See and remove hidden PDF metadata
- Office Metadata Cleaner: Remove author and revision data from Word, Excel and PowerPoint
- Images to PDF: Combine images into one PDF
- Image Editor: Crop, rotate, resize and adjust images
- Encrypt / Decrypt Text: Encrypt text with a passphrase (AES-GCM)
- SSH Key Generator: Generate Ed25519 and RSA SSH keys locally
- Email Header Analyzer: Trace an email's path and check SPF, DKIM and DMARC
- JSON to Code: Generate Go, Python, Rust, Java, C# and Kotlin models from JSON
- docker run ↔ Compose: Convert docker run commands to docker-compose and back
- Color Palette Extractor: Pull the dominant colours out of any image
- Password Strength Checker: How long would your password take to crack?
- SPF / DKIM / DMARC Checker: Validate and explain email DNS records
- Kubernetes YAML Checker: Validate and explain Kubernetes manifests
- .gitignore Generator: Build a .gitignore from presets
- CSP Builder: Build and check a Content-Security-Policy
- JSON-LD Generator: Create schema.org structured data
- Open Graph Image Generator: Make 1200×630 social preview images
- CSS Generator: Gradients, shadows, clamp() and more
- Time Zone Meeting Planner: Find meeting times across time zones