As a new and promising compression technology for hydrogen gas, the ionic liquid compressor inherits the advantages of the ionic liquid and the hydraulic system. The liquid density is one of the key parameters influencing the fluid flow field, the sloshing of the bulk liquid, and the movement of droplets generated during the compressor operation. An appropriate selection of the liquid density is important for the compressor design, which would improve the thermodynamic performance of the compressor. However, the density of the ionic liquid varied significantly depending on the specific combination of the cation and anions. This paper proposed the methodology to select the optimal liquid density used in the ionic liquid compressor for hydrogen storage. The gas-liquid interaction in the compression chamber is analysed through numerical simulations under varied liquid density values. Results found that the increase in the liquid density promoted the detachment of the ionic liquid from the cylinder cover during the suction procedure and the contact of the bulk liquid on the compressor cover when the gas is compressed in the cylinder during the compression procedure. Both the droplet size and the dimension of the derived gas vortex decreased when the liquid density increased. The lowest mass transfer of hydrogen through the outlet was obtained at the density of 1150 kg/m3. The density of the ionic liquid from 1300 to 1450 kg/m3 is suggested to the hydrogen compressor, taking into account the transient two-phase flow characteristics, the mass transfer, and the total turbulent kinetic energy.