Skip to content
ENExplore Calculators

IP Address Class Calculator

Work out ip address class instantly with clear inputs, formula shown and shareable results.

About IP Address Class Calculator

Classful addressing read the leading bits of the first octet: 0 meant class A with an 8-bit network part, 10 meant class B with 16 bits, 110 meant class C with 24 bits, 1110 marked multicast and 1111 was reserved. CIDR replaced this in 1993, but the class boundaries still explain default masks in older gear, certification questions and the shape of legacy allocations.

Formula

Class from first octet

1-126 = A (/8), 128-191 = B (/16), 192-223 = C (/24), 224-239 = D multicast, 240-255 = E reserved; hosts = 2^(32-prefix) - 2

Worked example

With the default values below, IP Address Class Calculator returns Address class of B (128-191). Change any input above and every figure here is recalculated in your browser.

Inputs used

IPv4 address
172.16.5.4
Show classful default maskone of Yes, No
Yes

Results

Address class
B (128-191)
Classful default prefix
16 /n
Classful default mask
255.255.0.0
Hosts per classful network
65,534

Step by step

  1. 1Values used
  2. 2Class from first octet
  3. 3Address class= B (128-191)
  4. 4Classful default prefix= 16 /n
  5. 5Classful default mask= 255.255.0.0
  6. 6Hosts per classful network= 65,534

Assumptions and limits

  • The result is derived only from the 2 inputs listed above. Anything not among them is not part of the calculation.
  • In particular, this calculator does not take inflation, tax, fees or charges or compounding frequency into account.
  • Figures are rounded for display to whole numbers, so totals built from several rounded parts can differ slightly from the unrounded arithmetic.

How these calculators are built and tested is described on the Methodology page. If a figure looks wrong, please report it.

Frequently Asked Questions

Is class still relevant?

Only for legacy defaults and exams. Modern routing is classless, so the mask is carried explicitly and any prefix length is valid regardless of the first octet.

Why is 127 excluded from class A?

127.0.0.0/8 is reserved for loopback, which is why the usable class A range stops at 126.

IP Address Class Calculator – Calculate Address class