IP / Mask Converter

Convert masks and address formats.

Enter any one of: a subnet mask, a CIDR prefix, a wildcard mask, or an IPv4 address. Get every other representation — including binary, hexadecimal, and 32-bit integer — instantly.

convert — ip/mask
type in any field and press Enter — the others fill in. mask/prefix/wildcard are linked; the IP field converts independently.
Invalid input
Mask representations
CIDR
Subnet mask
Wildcard mask
Mask binary
Host bits
Addresses
IPv4 address representations
Dotted decimal
32-bit integer
Hexadecimal
Binary (dotted)
How it works

A 32-bit IPv4 mask is a run of 1 bits (the network portion) followed by a run of 0 bits (the host portion). The three common ways to write it are equivalent:

The CIDR prefix counts the 1 bits — /24. The subnet mask writes those bits as dotted decimal — 255.255.255.0. The wildcard mask is the bitwise inverse, where 1 means "don't care" — 0.0.0.255 — and is what Cisco ACLs and OSPF use.

Address formats

An IPv4 address is just a 32-bit number. 192.168.1.200 is 0xC0A801C8, the integer 3232235976, or the binary 11000000.10101000.00000001.11001000. Tooling, packet captures, and firewall rules often surface one form when you need another.

A note on non-contiguous masks

This converter assumes a standard contiguous mask (all 1s then all 0s). Legacy non-contiguous masks exist but are deprecated and unsupported by modern routing.

FAQ
What's /24 as a subnet mask?

/24 = 255.255.255.0, wildcard 0.0.0.255, 256 total addresses.

Why do ACLs use wildcard masks instead of subnet masks?

It's a historical Cisco design choice. In a wildcard mask a 1 bit means "ignore this bit when matching," which is the inverse of a subnet mask. 0.0.0.255 matches any host in a /24.

How do I convert an IP to an integer?

Treat the four octets as a base-256 number: a*2^24 + b*2^16 + c*2^8 + d. This tool does it for you.