Chocolate is a sweet treat often associated with an energy or mood boost. It’s derived from seeds found in the fruit of cacao trees, which grow near the equator. These seeds are often referred to as cocoa beans.

Cocoa beans are removed from their shells, fermented, dried, and liquefied as part of the chocolate-making process. Chocolate contains a small amount of caffeine, as well as other substances that may help elevate mood or energy in some people.

Commercially prepared chocolate products also contain added ingredients, such as sugar, vanilla, and lecithin.

When cocoa beans are liquefied, the resulting liquid contains cocoa butter and cocoa solids. Both are used to make chocolate, although the amounts differ based upon the type of chocolate. Caffeine is found in cocoa solids, but not in cocoa butter.

You can usually determine the amount of caffeine in chocolate by how dark it is. The darker the chocolate, the more cocoa solids it contains. This increases the amount of caffeine it has per ounce. Since white chocolate contains only cocoa butter and no cocoa solids, it has zero caffeine.

The amount of caffeine in chocolate products can vary, especially if additional caffeine is added in order to provide an energy boost. Added caffeine can be found in energy bars and other products that also contain chocolate.

According to the United States Department of Agriculture:

Theobromine is found along with caffeine in cocoa solids. It gives dark chocolate its bitter taste. Caffeine and theobromine both contain naturally occurring substances that can stimulate the central nervous system. This can elevate your feelings of alertness and positively affect your mood.

Cocoa solids contain more theobromine than caffeine. Fifty grams of dark chocolate has 19 milligrams of caffeine and 250 milligrams of theobromine. Milk chocolate usually contains half that amount, sometimes less. White chocolate still has none since it contains no cocoa solids.

Theobromine may have anti-inflammatory properties and potentially inhibit tumor growth. It can help to suppress coughs and is sometimes used to treat asthma and other respiratory conditions.

Your veterinarian will be quick to tell you that chocolate is dangerous, sometimes even fatal, in dogs and cats. Animals metabolize theobromine more slowly than humans do, which is why the substance isn’t typically dangerous for people.

The amount of theobromine found in chocolate may positively affect your mood. However, in doses over 250 milligrams it may have the opposite effect.

Both theobromine and caffeine are stimulants. People who are very sensitive to caffeine may experience insomnia if they eat dark chocolate or drink hot cocoa too close to bedtime.