We present a method to compute a hierarchical approximate representation of the solutions of the Kohn-Sham equations. The method is based on a recursive bisection algorithm and yields one-particle wave functions localized on subdomains of varying sizes. The accuracy of the representation is set a priori by specifying the highest acceptable error in 2-norm for any solution. Applications to large systems are used to illustrate the achievable reduction in data size. Implications for the development of linear-scaling methods and for the acceleration of conventional iterative methods are discussed.