Why is gas(oline) in gas stations sold by volume (as opposed to mass)? Fluids (including natural gasoline/petroleum) have variable volume based on the ambient temperature for the same mass of fluid. So, really, the amount of gas that you're filling your car with depends on the temperature because it's not the volume of fuel that makes your car run, but the mass which is combusted. In aircraft, aviation fuel is always measured by the kilogram. So, why is it measured by volume for cars?
 A: I take it that the question being asked by OP is :
"""...Why is gas(oline) in gas stations sold by volume (as opposed to mass)?..."""
The answer is simple.   Gas stations get their gasoline delivered by "jobbers" who can supply them with gasoline that can come from a variety of different sources; even from different manufacturers.    Gas stations are equipped with simple equipment that can measure fluid VOLUME, and as most liquids, are of low compressibility (not zero), that is a fairly reliable measure (for commerce).
No gas station is equipped with any kind of equipment that can measure MASS which is a rather complex physical parameter to measure, and requires highly specialized equipment.
On the other hand, If I have read the question incorrectly, then forget that I gave an answer.
A: CNG fuel dispensers indeed measure mass not volume.
Mass flow meters (coriolis)do that job.
Pakistan has the biggest number of CNG vehicles as its a bit low cost(India is lagging behind Pakistan in CNG:)
@Qmechanic wrongly edited your question.
A: Interesting question -- my wild-ass guess is that they do it this way because there is a huge installed infrastructure and technical culture around volume-based measurement and accounting, in both the oil and auto industries, and it would be a correspondingly huge inconvenience to migrate to a mass-based system.
There are now available highly-accurate online flow densitometers that derive their signal from the natural frequency of a vibrating tube immersed in the fluid. No moving parts! Google a few obvious terms to find out more. They are accepted by oil ministries and other regulators for transfer of custody of petroleum, and it's not hard to imagine them being scaled down to forecourt pumps. But the sensors and electronics didn't exist when the industry was building-out its distribution and retail infrastructure about 100 years ago, and by the time they came along (50s? 60s? later?) it was too late.
A: First of all in aviation (from my previous work in this field) fuel usually measured by "US Gallons" which is a measure of volume, anyway usually in big tenders sometimes they measuring it in Tons (for a what called Jet A-1 class of this fuel -used for aircrafts- it is 1 Ton=331.3 US Gallons if I remember it right).
And regarding natural gas, the fact that up to a very high precession, most liquids can't be compressed, thus if you compress the gas to convert it into liquid, and knowing the density, you can always calculate it's weight, and this is very comfortable because it's much more efficient to transport gases in their liquid form.
Also considering natural gas heat capacity and temperature expansion coefficient, in usual temperature conditions it's volume changes in a very small amount, and I believe that it's much easier to dial with liquid gas in the car's engine than in it's normal state.
Finally, in your place, I would worry more about the "Energy conversion efficiency" of the gas, because usually the natural gas comes with a lot of other gases, that are not useful -in sense they can't burn in usual conditions-, this may cause your car to walk 50 km instead of 200km using same amount of gas.
