We developed a software package (CAVE) in Fortran language to detect internal cavities in proteins which can be applied also to an arbitrary system of balls. The volume, the surface area and other quantitative characteristics of the cavities can be calculated. The code is based on the recently suggested enveloping triangulation algorithm Busa et al., [J. Comp. Chem. 30 (2009) 346] for computing volume and surface area of the cavity by analytical equations. Different standard sets of atomic radii can be used. The PDB compatible file containing the atomic coordinates must be stored on the disk in advance. Testing of the code on different proteins and artificial ball systems showed efficiency and accuracy of the algorithm. The program is fast. It can handle a system of several thousands of balls in the order of seconds on contemporary PC's. The code is open source and free.