Data for the solubility of minerals in aqueous solutions at high pressures and temperatures are essential for our understanding of fluid properties, mass transport and growth/dissolution processes of minerals in Earth’s crust and upper mantle. Almost all available data on mineral solubility above 0.5 GPa have been obtained by ex situ quench methods in piston-cylinder-type apparatus. To exploit the obvious advantages of direct in situ solubility determinations in diamond anvil cells, we have developed simple in situ mass-loss approaches to calculate the mass of the observed crystal at any given pressure and temperature condition. This strategy combines the advantages of in situ and ex situ experiments while circumventing their disadvantages. In the present paper we describe a method that takes advantage of the tendency of crystals to approach an idiomorphic habit during hydrothermal diamond-anvil-cell runs. It can also be used for cleavage fragments. Using a modified version of the Kristall 2000 software designed for crystal drawing, the three-dimensional habit of a crystal can be modelled based on a two-dimensional digital image. This three-dimensional model allows the crystal volume and therefore its mass to be determined by measuring the exact length of just one crystal edge. The accuracy of this method is demonstrated by modelling the mass of various mineral grains of different shapes, morphologies, masses, densities and complexities, and comparing the modelled values to their actual weight. Modelled mass calculations are within 1σ = 0.38 % based on the Gaussian Error propagation for crystals varying from 0.2 to 38 mg. This method can be used not only for solubility experiments, but also in all situations where the crystalline sample is accessible only by optical methods.