Hydrogen: 33,300 Wh/kg (compressed: 39,443 Wh/kg)
Diesel: 35.8 MJ/L
Hydrogen: 9.17 MJ/L at 700 bar (10,000 psi).
It will require a tank of 4x the volume for the same energy which comes with many additional challenges. Plus, a tank that can withstand 700 bar will have to be extremely strong and heavy which hurts your energy/mass ratio.
1. https://en.wikipedia.org/wiki/Energy_density#Energy_densitie...