Chocolate contains caffeine, but in varying amounts depending on the type. A 1.5-ounce Hershey’s milk chocolate bar contains nine milligrams, about three times as much caffeine as a cup of decaffeinated coffee. But a dark chocolate Hershey’s candy bar has far more: about 30 milligrams, the same as a cup of instant tea.
Chocolate also has other stimulants. One is theobromine, which increases heart rate and causes sleeplessness.
In other words, eating chocolate at night can potentially keep you awake.
* New York Times January 12, 2009