What do cupcakes and batteries have in common? They can both be used as an energy source.

Surprisingly, cupcakes have a significantly higher energy density than today's lithium-ion batteries.

Y-H Percival Zhang, chief science officer of Cell-Free BioInnovations and an associate professor of biological systems engineering at Virginia Tech, published a journal in Nature Communications showing how sugar can be used to make batteries last longer.

"A sugar bio battery with such a high-energy density could last at least 10 times longer than existing lithium-ion batteries of the same weight," Zhang writes in the journal.

The battery converts chemical energy from glycogen and starch into electricity, according to First Post.

The new battery costs less than lithium-ion ones, and are refillable, environmentally friendly, and nonflammable, reports LiveScience.

Zhang tells LiveScience the researchers hope this sugar battery will take off since people are heavily reliant on mobile devices and need longer-lasting batteries.