Skip to main content
IP Range CalculatorPRO
IPv4 Subnetting & RangeInstant Client-Side Tool

CIDR Canonicalizer

Normalize prefixes to network boundaries.

CIDR Canonicalizer: inputs and results

Enter an IP address, CIDR prefix, or range. Then check its first and last address below.

Quick presets:

Calculated Boundaries & ParametersReady

Network Address192.168.1.0
Broadcast Address192.168.1.255
First Usable Host192.168.1.1
Last Usable Host192.168.1.254
Subnet Mask255.255.255.0
Wildcard Mask0.0.0.255
Total Addresses256
Usable Host Range254

How CIDR Canonicalizer Works?

The CIDR Canonicalizer works by clearing every host bit in the address so the entry starts on its prefix boundary. 192.168.1.77/24 becomes 192.168.1.0/24.

  1. Read each CIDR entry

    The canonicalizer accepts 1 entry or a list of entries, one per line.

  2. Build the mask

    The prefix length sets the mask. /20 gives 255.255.240.0.

  3. Apply the mask

    The canonicalizer runs address AND mask, which zeroes the host bits.

  4. Output canonical form

    The tool prints the aligned network with the original prefix and marks which entries changed.

CIDR Canonicalizer Formula

The CIDR Canonicalizer formula is Canonical = (IP AND Mask)/p, where the prefix length p stays the same.

Canonical address

C = IP AND Mask(p)

Host bits become 0.

Changed flag

Changed = (C ≠ IP)

Marks entries that had host bits set.

Host bits removed

Removed = IP AND Wildcard(p)

The value discarded during canonicalization.

Worked example: 172.31.200.9/20

Mask      = 255.255.240.0
3rd octet = 200 AND 240 = 192
4th octet = 9 AND 0 = 0
Canonical = 172.31.192.0/20
Removed   = 0.0.8.9 (host bits)

CIDR Canonicalizer Conversion Table

The CIDR Canonicalizer conversion table shows 12 input entries and their canonical form, with the host-bit value removed from each.

InputCanonical CIDRChangedHost Bits Removed
192.168.1.77/24192.168.1.0/24Yes0.0.0.77
10.1.2.3/810.0.0.0/8Yes0.1.2.3
172.31.200.9/20172.31.192.0/20Yes0.0.8.9
10.10.10.10/3010.10.10.8/30Yes0.0.0.2
203.0.113.200/25203.0.113.128/25Yes0.0.0.72
198.51.100.0/24198.51.100.0/24No0.0.0.0
100.70.5.5/10100.64.0.0/10Yes0.6.5.5
192.168.255.255/16192.168.0.0/16Yes0.0.255.255
10.0.15.1/2210.0.12.0/22Yes0.0.3.1
172.16.5.4/12172.16.0.0/12Yes0.0.5.4
192.0.2.130/26192.0.2.128/26Yes0.0.0.2
8.8.8.8/248.8.8.0/24Yes0.0.0.8

What is CIDR Canonicalizer?

The CIDR Canonicalizer is a tool that rewrites CIDR entries into canonical form, where the address part is the true network address of the prefix.

A CIDR entry such as 10.1.2.3/8 carries host bits that the prefix ignores. Most routers store it as 10.0.0.0/8, but databases, diff tools, and string comparisons treat both forms as different values. Canonical form gives every block exactly 1 spelling.

The canonicalizer keeps the prefix length unchanged. Changing the size of a block is a different operation, covered by the Supernet Calculator and the Prefix Expansion Calculator.

What are the uses of CIDR Canonicalizer?

There are 5 main uses of the CIDR Canonicalizer, including list deduplication, configuration diffs, and database keys.

  • Deduplicating CIDR lists

    10.1.2.3/8 and 10.0.0.0/8 become the same entry after canonicalization, so duplicates disappear.

  • Producing clean config diffs

    Canonical entries stop false differences between 2 versions of a firewall or routing file.

  • Creating database keys

    IPAM and CMDB tables use the canonical network as a unique key.

  • Normalizing user input

    Users often type a host address with a prefix. The canonicalizer stores the network instead.

  • Preparing BGP prefix lists

    Prefix lists match canonical networks. Canonicalization prevents entries that never match.