Hiccups are unintentional spasm of the diaphragm, which is the muscle located at the base of your lungs. The spasms cause your lungs to suck in air quickly, after which your epiglottis (a flap of tissue that covers your windpipe when you're swallowing so you won't inhale food into your lungs) slams shut. This is what produces the "hiccupping" sound. Usually the reason someone gets the hiccups is not known. More often than not hiccups start for no apparent reason and then they usually go away after just a few minutes. However, there are some things that are known to sometimes contribute to getting the hiccups.
Eating some foods may make it more likely for you to get the hiccups. These include hot and spicy foods or drinks and carbonated beverages. Eating and drinking too quickly or too much can give you the hiccups as well, as can consuming too much alcohol.
Aside from foods and beverages, other causes of hiccups can include sudden changes in temperature, emotional stress and excitement. There are some medications that can make you prone to hiccups, such as epilepsy medications, anesthesia and barbiturates. You're also more likely to get the hiccups after having stomach surgery, if you're a smoker or if you chew nicotine gum.
If your hiccups do not go away on their own and last for longer than 48 hours, you should see a doctor to rule out any underlying conditions. Persistent hiccups may be a symptom of a stroke, a cyst, tumor or goiter, or a disorder of the central nervous system (such as multiple sclerosis) or metabolic system (such as diabetes).
Some well-known home remedies for hiccups include drinking a glass of water, breathing into a paper bag, holding your breath, eating a spoonful of sugar or having someone scare you. If your hiccups are persistent there are medications and procedures your doctor may use to treat you.