A novel approach for computing the capacitance matrices of arbitrary shaped three-dimensional geometries is presented. The proposed approach combines an iterative solution of the pertinent integral equations with the Non-uniform Grid (NG) algorithm for fast evaluation of potentials due to given source distributions. The NG approach is based on the observation that locally the potential produced by a finite size source can be interpolated from its samples at a small number of points of a non uniform spherical grid. This observation leads to a multilevel algorithm comprising interpolation and aggregation of potentials. The resulting hierarchical algorithm attains an O(N) asymptotic complexity.