It is often the case that the moments of a distribution can be readily determined, while its exact density function is mathematically intractable. We show that the density function of a continuous distribution defined on a closed interval can be easily approximated from its exact moments by solving a linear system involving a Hilbert matrix. When sample moments are being used, the same linear system will yield density estimates. A simple formula that is based on an explicit representation of the elements of the inverse of a Hilbert matrix is being proposed as a means of directly determining density estimates or approximants without having to resort to kernels or orthogonal polynomials. As illustrations, density estimates will be determined for the 'Buffalo snowfall' data set and the density of the distance between two random points in a cube will be approximated. Finally, an alternate methodology is proposed for obtaining smooth density estimates from averaged shifted histograms.