ipcalc: network calculator on the command line

August 22nd, 2007 edited by lucas

Article submitted by Javier Barroso. We are running out of articles ! Please help DPOTD and submit good articles about software you like NOW !

Ipcalc is a command-line tool which allows the user to get useful data from a ip and a netmask.

Ipcalc returns the network address, netmask, network address in CIDR notation, min/max IP addresses, broadcast address and the number of hosts of network.

Ipcalc usage is:

Usage: ipcalc [options] <ADDRESS>[[/]<NETMASK>] [NETMASK]

A example could be:

$ ipcalc
Address:            00001010.00000000.00000000. 00011100
Netmask: = 24   11111111.11111111.11111111. 00000000
Wildcard:            00000000.00000000.00000000. 11111111
Network:          00001010.00000000.00000000. 00000000
HostMin:             00001010.00000000.00000000. 00000001
HostMax:           00001010.00000000.00000000. 11111110
Broadcast:           00001010.00000000.00000000. 11111111
Hosts/Net: 254                   Class A, Private Internet

Ipcalc has been available in Debian at least since v3.1 (’Sarge’) and in Ubuntu since Warty. apt-get install ipcalc will install it for you.

Posted in Debian, Ubuntu |

8 Responses

  1. stilus Says:

    Nice little tool, Thanks!

  2. shiny Says:


  3. Tristan Rhodes Says:

    Very cool! I have just installed it and I like it very much. Great for network engineers. But aren’t we supposed to be able to do that in our head? Naaah! ;)

  4. anonymous Says:

    even the same, but more popular:


    (yum install whatmask or: ./configure;make;make install)

  5. action09 Says:

    One useful option is “-n” that don’t display the colors…


    ipcalc -n

    nice tool !

  6. mp Says:

    Definitely useful. Two alternates: first, search for “ipcalc online”, etc, and use this without installing it. Eg:

    Second, if you have shorewall installed, it includes a similar facility: “shorewall ipcalc″

  7. Juanmi Says:

    ¡¡¡¡Nice tool!!!!

  8. ipv6 Says:

    There is also sipcalc which also supports IPv6…

    $ sipcalc
    -[ipv4 :] - 0

    Host address -
    Host address (decimal) - 167772188
    Host address (hex) - A00001C
    Network address -
    Network mask -
    Network mask (bits) - 24
    Network mask (hex) - FFFFFF00
    Broadcast address -
    Cisco wildcard -
    Addresses in network - 256
    Network range - -
    Usable range - -