WintelGuy.com

IP and Mask Visual Calculator

Enter IP address either in a dot-decimal notation or in CIDR notation. In the latter case, the provided prefix length overrides the Subnet mask value.

IP address: Enter IP address in a dot-decimal notation or in CIDR notation. If provided, prefix length overrides the Subnet mask value.
Subnet mask: Select subnet mask.
http://wintelguy.com/ip-mask-visualizer.pl?si=10.1.1.5&bitmask=24

IP Address, Mask, and Subnet Details:

IP address: 10.1.1.5
IP class: A
Subnet mask: 255.255.255.0
Subnet address: 10.1.1.0
Bits in mask: 24
Number of hosts: 254
0102030405060708 0910111213141516 1718192021222324 2526272829303132
1286432168421 1286432168421 1286432168421 1286432168421
IP:10.1.1.5
10115
00001010000000010000000100000101
Mask:255.255.255.0
2552552550
11111111111111111111111100000000
Net Prefix:10.1.1.0
10110
00001010000000010000000100000000
Broadcast:10.1.1.255
1011255
00001010000000010000000111111111
First Host:10.1.1.1
10111
00001010000000010000000100000001
Last Host:10.1.1.254
1011254
00001010000000010000000111111110
1286432168421 1286432168421 1286432168421 1286432168421
0102030405060708 0910111213141516 1718192021222324 2526272829303132

Color code: Network Address BitsHost Address Bits

About IP/Mask Visual Calculator

This subnet calculator can perform the following tasks:

  • Identify subnet parameters for a given IP address and subnet mask (or CIDR prefix);
  • Display IP and subnet details in an easy to understand binary format;
  • Illustrate correlation between different subnet parameters, such as subnet mask, network prefix, broadcast address, etc.;
  • Show usable host IP address range.

Start by entering IP address either in a dot-decimal notation (e.g., 10.1.1.5) or in CIDR notation (e.g., 10.1.1.5/24). In the latter case, the provided prefix length will define the Subnet mask value. This calculator supports prefix length in the range /2 .. /31.

Click Submit to show the results.

Click Copy link to copy to the clipboard the link to this page with the entered IP and subnet values.

Use Copy table to send the content of the subnet table to the clipboard.

CIDR stands for Classless Inter-Domain Routing. CIDR refers to a method for routing Internet Protocol (IP) packets and for allocating of IP addresses.

Number of hosts on a /31 subnet:
Generally, within a subnet, two host addresses - all-zeros and all-ones are reserved as network address and broadcast, respectively. The same approach applied to a /31 subnet with only two possible addresses in the host identifier would leave no usable addresses for host assignment. RFC3021: Using 31-Bit Prefixes on IPv4 Point-to-Point Links allows assignment of the all-zeros and all-ones IP addresses to hosts on point-to-point links.

This page is best viewed in a browser window at least 860 px wide.

IPs and Masks in Binary Representation

IP addresses are typically represented in decimal format (e.g., 192.168.10.1). Converting these addresses into binary allows us to see the individual bits that make up the address. This binary representation helps visualize how the address is structured and how each octet contributes to the network and host portions of the address.

Suppose we have the IP address 192.168.10.1 and mask 255.255.255.0. In binary, they would be represented as:

11000000.10101000.00001010.00000001 (IP address)
11111111.11111111.11111111.00000000 (Subnet mask)

Using binary operations, we can determine various subnet parameters:

Mask Length: The number of consecutive 1s in the subnet mask represents the mask length. In this case, 24 bits are set to 1, indicating a mask length of 24.

Network Prefix/Network Address: To find the network prefix or network address, we apply a bitwise AND operation between the IP address and the subnet mask. This operation preserves the network portion of the IP address while setting all host bits to 0. For our example:

11000000.10101000.00001010.00000000 (IP address)
11111111.11111111.11111111.00000000 (Subnet mask)
bitwise AND -----------------------
11000000.10101000.00001010.00000000 (Network prefix)

So, the network address is 192.168.10.0. In CIDR notation it is expressed as 192.168.10.0/24, where "24" represents the prefix length.

Prefix Length: The prefix length is the number of bits used for the network portion of the address. Similarly to the mask length, it is determined by the number of 1s in the subnet mask.

Broadcast Address: The broadcast address is the highest address in the subnet and is obtained by setting all host bits to 1. To calculate the broadcast address, we perform a bitwise OR operation between the network address and the inverted subnet mask:

11000000.10101000.00001010.00000000 (Network address)
00000000.00000000.00000000.11111111 (Inverted subnet mask)
bitwise OR ------------------------
11000000.10101000.00001010.11111111 (Broadcast address)

So, the broadcast address is 192.168.10.255.

Host Address Range: The host address range includes all addresses within the subnet except for the network and broadcast addresses. For our example, the host address range is from 192.168.10.1 to 192.168.10.254.

By utilizing our visual calculator to present IP addresses and subnet parameters in binary format, network engineers can better understand how variable length subnet masking works and manage IP address allocations within a network more effectively.