Direct compaction is a complex process that results in a density distribution inside the tablets which is often heterogeneous. Therefore, the density variations may affect the compact properties. A quantitative analysis of this phenomenon is still lacking. Recently, X-ray microtomography has been successfully used in pharmaceutical development to study qualitatively the impact of tablet shape and break-line in the density of pharmaceutical tablets. In this study, we evaluate the density profile in microcrystalline cellulose (Vivapur 12®) compacts obtained at different mean porosity (ranging from 7.7% to 33.5%) using X-ray tomography technique. First, the validity of the Beer–Lambert law is studied. Then, density calibration is performed and density maps of cylindrical tablets are obtained and visualized using a process with colour-scale calibration plot which is explained. As expected, important heterogeneity in density is observed and quantified. The higher densities in peripheral region were particularly investigated and appraised in regard to the lower densities observed in the middle of the tablet. The results also underlined that in the case of pharmaceutical tablets, it is important to differentiate the mechanical properties representative of the total volume tablet and the mechanical properties that only characterize the tablet surface like the Brinell hardness measurements.