Ip addresses and subnetting

i will like to know how to calculate for the number of ips to use for my network.
for example if i want to use 255 ips i know its 192.168.0.1/24 and this gives me up to 192.168.0.255

what about 2,4.6.12. and so on

/30 for 2 IPs
/29 for 6 ips
/28 for 14 IPs
and so on
http://www.mikrotik.com/img/netaddresses2.pdf

http://jodies.de/ipcalc
It’s the first result of google
http://www.google.com/search?q=ipcalc