If you are looking forward to your first stiff drink after a dry January, be warned: it may feel bittersweet. You may feel you deserve an alcoholic beverage after toughing it out all month – but have you forgotten what it feels like to wake up haunted by worries about what you said or did the night before? These post-drinking feelings of guilt and stress have come to be known colloquially as “hangxiety”. But what causes them?

David Nutt, professor of neuropsychopharmacology at Imperial College, London, is the scientist who was fired in 2009 as the government’s chief drug adviser for saying alcohol is more dangerous than ecstasy and LSD. I tell him I have always assumed my morning-after mood was a result of my brain having shrivelled like a raisin through alcohol-induced dehydration. When Nutt explains the mechanics of how alcohol causes crippling anxiety, he paints an even more offputting picture.

Alcohol, he says, targets the Gaba (gamma-aminobutyric acid) receptor, which sends chemical messages through the brain and central nervous system to inhibit the activity of nerve cells. Put simply, it calms the brain, reducing excitement by making fewer neurons fire. “Alcohol stimulates Gaba, which is why you get relaxed and cheerful when you drink,” explains Nutt.

The first two drinks lull you into a blissful Gaba-induced state of chill. When you get to the third or fourth drink, another brain-slackening effect kicks in: you start blocking glutamate, the main excitatory transmitter in the brain. “More glutamate means more anxiety,” says Nutt. “Less glutamate means less anxiety.” This is why, he says, “when people get very drunk, they’re even less anxious than when they’re a bit drunk” – not only does alcohol reduce the chatter in your brain by stimulating Gaba, but it further reduces your anxiety by blocking glutamate. In your blissed-out state, you will probably feel that this is all good – but you will be wrong.

The body registers this new imbalance in brain chemicals and attempts to put things right. It is a little like when you eat a lot of sweets and your body goes into insulin-producing overdrive to get the blood sugar levels down to normal; as soon as the sweets have been digested, all that insulin causes your blood sugar to crash. When you are drunk, your body goes on a mission to bring Gaba levels down to normal and turn glutamate back up. When you stop drinking, therefore, you end up with unnaturally low Gaba function and a spike in glutamate – a situation that leads to anxiety, says Nutt. “It leads to seizures as well, which is why people have fits in withdrawal.”

It can take the brain a day or two to return to the status quo, which is why a hair of the dog is so enticing. “If you drank an awful lot for a long time,” says Nutt, “it might take weeks for the brain to readapt. In alcoholics, we’ve found changes in Gaba for years.”

To add to the misery, the anxiety usually kicks in while you are trying to sleep off the booze. “If you measure sleep when people are drunk, they go off to sleep fast. They go into a deeper sleep than normal, which is why they sometimes wet the bed or have night terrors. Then, after about four hours, the withdrawal kicks in – that’s when you wake up all shaky and jittery.”

Imbalances in Gaba and glutamate are not the only problem. Alcohol also causes a small rise in noradrenaline – known as the fight-or-flight hormone. “Noradrenaline suppresses stress when you first take it, and increases it in withdrawal,” says Nutt. “Severe anxiety can be considered a surge of noradrenaline in the brain.”

Another key cause of hangxiety is being unable to remember the mortifying things you are sure you must have said or done while inebriated – another result of your compromised glutamate levels. “You need glutamate to lay down memories,” says Nutt, “and once you’re on the sixth or seventh drink, the glutamate system is blocked, which is why you can’t remember things.”

If this isn’t ringing any bells, it may be because hangxiety does not affect us all equally, as revealed by a study published in the journal Personality and Individual Differences. Researchers quizzed healthy young people about their levels of anxiety before, during and the morning after drinking alcohol. According to one of the authors, Celia Morgan, professor of psychopharmacology at the University of Exeter: “The people who were more shy had much higher levels of anxiety [the following day] than the people who weren’t shy.” The team also found a correlation between having bad hangxiety and the chance of having an alcohol use disorder. “Maybe it’s playing a role in keeping problematic drinking going,” says Morgan.

One theory as to why very shy people might be more at risk of hangxiety and alcoholism is the possibility that alcohol’s seesaw effect on Gaba levels is more pronounced in them. Their baseline Gaba levels may be lower to start with, says Morgan. “It could also be a psychological effect – people who are more highly anxious are more prone to rumination, going over thoughts about the night before, so that’s another potential mechanism.”

However, the study’s findings have wider implications – after all, most drinkers lean on alcohol as social lubrication to some degree.

The bad news is that there seems to be little you can do to avoid hangxiety other than to drink less, and perhaps take painkillers – they will at least ease your headache. “Theoretically, ibuprofen would be better than paracetamol,” says Nutt, “because it’s more anti-inflammatory – but we don’t know how much of the hangover is caused by inflammation. It’s something we’re working on, trying to measure that.”

Morgan suggests trying to break the cycle. “Before drinking in a social situation you feel anxious in, try fast-forwarding to the next day when you’ll have much higher anxiety levels. If you can’t ride that out without drinking, the worry is that you will get stuck in this cycle of problematic drinking where your hangxiety is building and building over time. Drinking might fix social anxiety in the short term, but in the long term it might have pretty detrimental consequences.” Exposure therapy is a common treatment for phobias, where you sit with your fear in order to help you overcome it. “By drinking alcohol, people aren’t giving themselves a chance to do that,” says Morgan.

But there might be hope for the future. Nutt is involved in a project to develop a drink that takes the good bits of alcohol and discards the damaging or detrimental effects. “Alcosynth”, as it is currently called, drowns your sorrows in the same way as alcohol, but without knocking the Gaba and glutamate out of kilter. “We’re in the second stage of fundraising to take it through to a product,” he says. “The industry knows [alcohol] is a toxic substance. If it was discovered today, it would be illegal as a foodstuff.”

Until Alcosynth reaches the market, Nutt says his “strong” message is: “Never treat hangxiety with a hair of the dog. When people start drinking in the mornings to get over their hangxiety, then they’re in the cycle of dependence. It’s a very slippery slope.”