It takes about 60 kw/h of electricity to produce 1 kg of hydrogen by electrolysis. 1kg of hydrogen is equivalent to 1 gallon of gasoline.
Electricity from the grid costs about 10c per kw/h. Alternatives like solar and wind cost more.
Transporting hydrogen is also expensive. You have to either compress it, which uses 20% as much energy as the hydrogen contains, or better still liquefy it, which uses 40%.