Cal11 calculator

Write The Following Masks in Slash Notation in Calculator

Reviewed by Calculator Editorial Team

Understanding slash notation is essential for network configuration and IP addressing. This guide explains how to write subnet masks in slash notation using our interactive calculator.

What is slash notation?

Slash notation (CIDR notation) is a compact way to represent IP addresses and their associated routing prefix. It combines the IP address with a prefix length that indicates how many bits of the address are fixed.

The format is: IP address/prefix length. For example, 192.168.1.0/24 means the first 24 bits of the IP address are fixed, with the remaining 8 bits available for host addresses.

CIDR stands for Classless Inter-Domain Routing, which replaced the older class-based addressing system in IPv4.

How to convert subnet masks to slash notation

To convert a subnet mask to slash notation:

  1. Write the subnet mask in dotted-decimal notation (e.g., 255.255.255.0)
  2. Convert each octet to binary (e.g., 255 = 11111111, 0 = 00000000)
  3. Count the number of consecutive 1 bits from the left
  4. This count is your prefix length (e.g., 255.255.255.0 has 24 consecutive 1 bits)

Formula: Prefix length = number of 1 bits in the subnet mask

For example, converting 255.255.254.0:

  • 255 = 11111111 (8 bits)
  • 255 = 11111111 (8 bits)
  • 254 = 11111110 (7 bits)
  • 0 = 00000000 (0 bits)
  • Total = 8 + 8 + 7 = 23 bits

The slash notation would be /23.

Common subnet masks and their slash notation

Subnet Mask Slash Notation Usable Hosts
255.0.0.0 /8 16,777,214
255.255.0.0 /16 65,534
255.255.255.0 /24 254
255.255.255.128 /25 126
255.255.255.192 /26 62
255.255.255.224 /27 30
255.255.255.240 /28 14
255.255.255.248 /29 6
255.255.255.252 /30 2

Using the slash notation calculator

Our interactive calculator makes it easy to convert subnet masks to slash notation. Simply enter the subnet mask in the provided field and click "Calculate". The result will show the equivalent slash notation and additional information.

The calculator uses the standard conversion method described in the previous section. It handles all valid IPv4 subnet masks.

FAQ

What is the difference between slash notation and dotted-decimal notation?
Slash notation (CIDR) combines an IP address with a prefix length, while dotted-decimal notation shows the subnet mask as four octets. Both represent the same information but in different formats.
Can I use slash notation with IPv6 addresses?
Yes, slash notation is also used with IPv6 addresses. The number after the slash represents the number of bits in the network prefix.
What happens if I enter an invalid subnet mask?
The calculator will display an error message. Subnet masks must be valid IPv4 addresses with consecutive 1 bits followed by consecutive 0 bits.
How do I determine the number of usable hosts from slash notation?
The number of usable hosts is calculated as 2^(32 - prefix length) - 2. The subtraction accounts for the network and broadcast addresses.
Is slash notation used only for network configuration?
While slash notation is most commonly used in network configuration, it's also used in routing tables, firewall rules, and other networking contexts.