You probably know the feeling: You’re in a tense situation and you suddenly feel an insanely powerful urge to laugh.

Don’t worry, you’re not crazy for doing this — it’s a phenomenon called nervous laughter.

Nervous laughter is called an incongruous emotion. This means that you experience an emotion when the situation doesn’t necessarily call for it.

Nervous laughter happens for a number of reasons. Some research suggests that your body uses this sort of mechanism to regulate emotion. Other research has found that nervous laughter may be a defense mechanism against emotions that may make us feel weak or vulnerable.

Either way, it’s pretty weird to experience. Uncontrollable nervous laughter may also be a symptom of an underlying condition.

Yale University psychologist Stanley Milgram conducted one of the earliest and most infamous studies with data about nervous laughter in the 1960s.

His study revealed that people often laughed nervously in uncomfortable situations. People in his study were asked to give electric shocks to a stranger, with the shocks becoming increasingly powerful (up to 450 volts).

But the “strangers” in this case were researchers involved in the study — they weren’t actually being shocked. But participants were more likely to laugh at the violence of the situation the higher the volts went.

Neuroscientist V.S. Ramachandran explored this idea in his book “A Brief Tour of Human Consciousness.” He proposes that laughter first appeared in human history as a way to indicate to those around us that whatever was making us laugh wasn’t a threat or worth worrying about.

So we’re essentially reassuring ourselves that whatever’s making us uncomfortable isn’t that big a deal when we laugh at an uncomfortable situation.

This could be a result of a cognitive defense mechanism for lowering anxiety associated with discomfort or showing the threat itself that we don’t fear it.

Ramachandran also suggests that laughter helps us heal from trauma by distracting ourselves from the pain and associating that pain with a positive emotion. This could be why nervous laughter can happen even at funerals or other sad and traumatic events.

A 2015 study from a team of Yale researchers also found that people tend to respond with a variety of unexpected emotions to strong outside stimuli.

The researchers discovered an association between the strong emotions you feel when you see a cute baby, like wanting to pinch its cheek and speak to it in weird voices, and the urge to laugh when you’re nervous or anxious.

So nervous laughter may also just be part of a larger pattern within the brain to react with strong emotions of all sorts to emotionally provocative stimuli, no matter if it seems appropriate.

Uncontrollable laughter that seems like nervous laughter may actually be the result of an underlying medical condition.

Here are a few of the most common possible causes of nervous laughter.

Pseudobulbar affect

Pseudobulbar affect (PBA) happens when you have episodes of strong emotions that aren’t necessarily appropriate for the situation. Your mood and emotions tend to be just fine otherwise aside from these brief episodes of strong emotion.

Imagine someone tells a joke that you didn’t find that funny. But you start bursting out in loud, raucous laughter anyway — this is one possible way that PBA can manifest.

This symptom is linked to conditions that affect your brain like a traumatic brain injury (TBI) or a neurological disorder like multiple sclerosis (MS).

Hyperthyroidism

Hyperthyroidism happens when your thyroid gland makes too much of one or both thyroid hormones called T4 and T3. These hormones regulate your cells’ energy use and maintain your metabolism. Nervous laughter is a common symptom of hyperthyroidism.

Autoimmune conditions like Graves’ disease are the most common causes of hyperthyroidism. Some other possible causes include:

  • consuming too much iodine
  • thyroid gland inflammation
  • having benign tumors on your thyroid or pituitary gland
  • having tumors on your testicles or ovaries
  • consuming too much tetraiodothyronine from nutritional supplements

Graves’ disease

Graves’ disease happens when your immune system makes too many antibodies that hook up with thyroid cells. These thyroid cells get to your thyroid gland and overstimulate the gland. This causes the thyroid to make too much thyroid hormone.

Having too much thyroid hormone in your body can affect your nervous system. One symptom of this is nervous laughter even when nothing is happening that you find funny.

Some other common symptoms of Graves’ disease include:

  • shaking hands tremors
  • losing weight without an obvious cause
  • abnormally fast heart rate
  • getting hot easily
  • exhaustion
  • feeling nervous or irritable
  • weak muscle strength
  • thyroid gland swelling, known as a goiter
  • pooping more than usual or having diarrhea
  • trouble sleeping

Kuru (TSEs)

Kuru is a rare condition known as a prion disease. Creutzfeldt-Jakob disease is a more common type of this condition, also as known as transmissible spongiform encephalopathies (TSEs).

Kuru happens when an abnormal protein called a prion infects your brain. Prions can build up and clump together in your brain. This can keep your brain from functioning properly.

Kuru damages a part of your brain called the cerebellum. This is where many cognitive and emotional processes are located. Prions can disrupt your emotional responses and lead to nervous laughter.

Some other common symptoms include:

  • trouble walking or with coordination
  • trouble swallowing
  • slurry speech
  • being moody or experiencing abnormal behavioral shifts
  • signs of dementia or memory loss
  • twitching or shaking in your muscles
  • trouble grabbing things

Nervous laughter isn’t always easy to control, especially if it’s the result of a medical condition.

Here are some strategies you can use to control your nervous laughter when it’s inappropriate for the situation:

  • Deep breathing exercises. These relax anxiety that can overstimulate your nervous system and your brain.
  • Quiet meditation. Use meditation to calm your mind and focus on something besides your stressors or other drains on your cognitive and emotional energy.
  • Yoga. Movement through yoga can relax both your body and mind.
  • Art and music therapy. These allow you to focus on the artistic and creative process and stimulate your brain.
  • Cognitive behavioral therapy (CBT). You can learn how to actively disrupt nervous laughter with conscious responses.

Here are some possible treatments for the conditions that can cause nervous laughter:

  • Hyperthyroidism. Methimazole (Tapazole) can help control hormone production and iodine destroys extra hormone cells. Thyroid removal surgery is also a possibility.
  • Graves’ disease. The treatment is generally the same as hyperthyroidism, with some minor differences depending on your symptoms.
  • Kuru or other degenerative brain diseases. There are medications to help you manage the symptoms, but there’s no cure for many of these conditions.

You may want to see a therapist or counselor if you find yourself laughing at inappropriate times and it’s disrupting your life. They can help you through CBT or similar strategies to learn how to cope and control nervous laughter.

See your doctor as soon as possible if you have any of the symptoms listed that might suggest a medical condition. You’re more likely to prevent possible complications if you treat these conditions early.

Nervous laughter isn’t something to be anxious or embarrassed about. Research suggests that it may actually be a useful tool against negative emotions or during a hard time in your life.

See a therapist or doctor if your nervous laughter:

  • is uncontrollable
  • disrupts your personal or professional life
  • happens along with more severe symptoms