Gas pycnometry is based on Boyle-Mariotte's law of volume-pressure relationships. This method has been widely used to determine the volume (and thus the density) of rock fragments, soluble powders, light objects and even living beings. Surprisingly, little is known about the optimum design of gas pycnometers. The purpose of this study was to investigate the optimum design of a gas pycnometer, so that it can determine the volume of solid particles with the greatest accuracy. The 'constant-volume' gas pycnometer was considered because of its widespread use. The law of propagation of uncertainty was used to derive a theoretical formula that relates the pycnometer's accuracy to the main sources of random error (gas-pressure measurements, pycnometer temperature and sample-chamber volume). The consequences of this formula in terms of optimizing the geometry and working conditions of the pycnometer are discussed. It was found that some gas pycnometers described in the literature may have not been used under the best conditions. Guidelines are given to design a gas pycnometer that can theoretically determine the volume of solid particles with a relative standard uncertainty smaller than 0.2%.