TNT.....: 4 kJ/gram and 7 MJ/liter
Gasoline: 43 kJ/gram and 33 MJ/literEdit: Or, a fair closed-system comparison to a battery would need to include a liquid oxygen tank or similar so you have the two components stored but can control the delivery...
As a stupid example, if we have a high density battery technology that never explodes unless, say, under magnetic forces only seen being produced by magnetars, that's a pretty safe battery.
eeeh that still doesn't matter really. Gasoline is safe(r) because it needs conditions to explode (spreading into area then ignition), instead of just detonator. Diesel even more so
A damaged gasoline tank that's near empty might explode but more likely it will just leak and start burning, and probably at that moment be still extinguishable. Explosives, well, you won't have time to blink.
Batteries ? Zero chance to extinguish, gonna let it burn thru. THAT is the problem
Interesting discussions about energetics are best had from a distance.
The fuels which afford the highest rates of storage tend to release it more slowly. Chemical explosives typically have about 1/10 the energy storage capacity (by mass) of fuels, as several people have pointed out.
Similar relationships exist for other forms of energy storage. For electricity, fuel cells, chemical cells ("batteries"), flywheel / reaction storage, and capacitors tend to offer a trade-off between total storage capacity and reaction time. Capacitors can react at intra-phase rates (that is, within a single 60Hz power cycle), whilst batteries and flywheels can take longer to come online.
See for example: "Battery Parameters" <https://www.monolithicpower.com/en/learning/mpscholar/batter...>.
Energy density of gasoline is approximately 44 to 45 megajoules per kilogram.
Energy density of TNT is approximately 4.184 megajoules per kilogram.
https://en.wikipedia.org/wiki/Table_of_explosive_detonation_...
There is a way how to use the energy density of gasoline for explosive purposes, Thermobaric weapons.
"A fuel–air explosive (FAE) device consists of a container of fuel and two separate explosive charges. After the munition is dropped or fired, the first explosive charge bursts open the container at a predetermined height and disperses the fuel in a cloud that mixes with atmospheric oxygen (the size of the cloud varies with the size of the munition). The cloud of fuel flows around objects and into structures. The second charge then detonates the cloud and creates a massive blast wave."
I’ve seen a few gasoline fires that start by burning, and then much more rapidly expressing potential.
They did get it to happen, they just had to try really hard.
In most accidents the gas tank will not blow up.
"Petrol and diesel can only explode when under pressure and mixed with air and in the case of petrol, have a small amount of energy added in the form of a spark or a flame. Engines pressurise the fuel/air mixture in the cylinder and so produce small, confined explosions which turn a crankshaft and drive the wheels."
"When cars are involved in collisions, fuel lines are often torn and petrol leaks out onto a hot engine. Liquid petrol can catch fire in the presence of air. But it can’t explode because it’s not under pressure and is in the liquid phase rather than a vapour."
https://theconversation.com/fast-x-why-cars-dont-really-expl...
My teen years would beg to differ, when some neighborhood friends and I decided to experiment with gas and bleach. The neighborhood residents, fire department and local police also had an opinion, too. (We all got into BIG trouble. Definitely one of the dumber things I did as a teen.)
My high-school crowd stopped just short of building a multistage FAE device. I left early for college and everybody else was short of cash, and that was the end of our neighborhood R&D program. All pre-9/11, needless to say. It's a lot less fun when the possible punishment goes from detention at lunch to waterboarding in Gitmo.
BRB, stopping by the laundry room on my way to the garage...
What it does do is slowly polymerize, becoming useless as an ICE fuel in time, typically in a year or two. This is why backup generators should run on propane, which has no degradation mechanism.
Edit: https://petapixel.com/2015/06/11/explosion-at-junk-yard-phot...