Imagine a dream in which you sense an intense feeling of presence, the truest, most real experience in your life, as you float away from your body and look at your own face. You have a twinge of fear as memories of your life flash by, but then you pass a transcendent threshold and are overcome by a feeling of bliss. Although contemplating death elicits fear for many people, these positive features are reported in some of the near-death experiences (NDEs) undergone by those who reached the brink of death only to recover.

Accounts of NDEs are remarkably consistent in character and content. They include intensely vivid memories involving bodily sensations that give a strong impression of being real, more real even than memories of true events. The content of those experiences famously includes memories of one’s life “flashing before the eyes,” and also the sensation of leaving the body, often seeing one’s own face and body, blissfully traveling through a tunnel toward a light and feeling “at one” with something universal.

Not surprisingly, many have seized on NDEs as evidence of life after death, heaven and the existence of god. The descriptions of leaving the body and blissful unity with the universal seem almost scripted from religious beliefs about souls leaving the body at death and ascending toward heavenly bliss. But these experiences are shared across a broad range of cultures and religions so it’s not likely that they are all reflections of specific religious expectations. Instead, that commonality suggests that NDEs might arise from something more fundamental than religious or cultural expectations. Perhaps NDEs reflect changes in how the brain functions as we approach death.

Many cultures employ drugs as part of religious practice to induce feelings of transcendence that have similarities to near-death experiences. If NDEs are based in brain biology, perhaps the action of those drugs that causes NDE-like experiences can teach us something about the NDE state. Of course, studying NDEs has significant technical hurdles. There is no way of examining the experience in animals, and rescuing a patient at death’s door is far more important than interviewing them about their NDE. Moreover, many of the drugs used to induce religious states are illicit, which would complicate any efforts to study their effects.

Although it’s impossible to directly examine what happens to the brain during NDEs, the stories collected from them provide a rich resource for linguistic analysis. In a fascinating new study, NDE stories were compared linguistically with anecdotes of drug experience in order to identify a drug that causes an experience most like a near-death experience. What is remarkable is how precise a tool this turned out to be. Even though the stories were open-ended subjective accounts often given many years after the fact, the linguistic analysis focused down not only to a specific class of drugs, but also to a specific drug as causing experiences very similar to NDEs.

This new study compared the stories of 625 individuals who reported NDEs with the stories of more than 15,000 individuals who had taken one of 165 different psychoactive drugs. When those stories were linguistically analyzed, similarities were found between recollections of near-death and drug experiences for those who had taken a specific class of drug. One drug in particular, ketamine, led to experiences very similar to NDE. This may mean that the near-death experience may reflect changes in the same chemical system in the brain that is targeted by drugs like ketamine.

The researchers drew on a large collection of NDE stories they had collected over many years. To compare NDEs with drug experiences, the researchers took advantage of a large collection of drug experience anecdotes found in the Erowid Experience Vaults, an open-source collection of accounts describing firsthand experiences with drugs and various substances.

In this study, the recollections of those who experienced NDEs and those who took drugs were compared linguistically. Their stories were broken down into individual words, and the words were sorted according to their meaning and counted. In this way, researchers were able to compare the number of times words having the same meaning were used in each story. They used this numerical analysis of story content to compare the content of drug-related and near-death experiences.

Each of the drugs included in these comparisons could be categorized by their ability to interact with a specific neurochemical system in the brain, and each drug fell into a specific category (antipsychotic, stimulant, psychedelic, depressant or sedative, deliriant, or hallucinogen). Few similarities were found when the accounts of one stimulant drug were compared with another within the same stimulant drug class, and few if any similarities were found between accounts of stimulant drug experience and NDEs. The same was true for depressants. The stories associated with hallucinogens, however, were very similar to one another, as were stories linked to antipsychotics and deliriants. When recollections of drug effects were compared with NDEs, stories about hallucinogens and psychedelics had the greatest similarities to NDEs, and the drug that scored the highest similarity to NDEs was the hallucinogen ketamine. The word most strongly represented in descriptions of both NDEs and ketamine experiences was “reality,” highlighting the sense of presence that accompanies NDEs. High among the list of words common to both experiences were those related to perception (saw, color, voice, vision), the body (face, arm, foot), emotion (fear) and transcendence (universe, understand, consciousness).

The researchers then sorted words into five large principal groups according to their common meaning. Those principal components dealt with perception and consciousness, drug dependency, negative sensations, drug preparation, and also a group that included disease state, religion and ceremony. NDEs reflected three of these components related to perception and consciousness, religion and ceremony, disease state, and drug preparation. The component related to perception and consciousness was labeled “Look/Self” and included terms such as color, vision, pattern, reality and face. The component “Disease/Religion” contained elements such as anxiety, ceremony, consciousness and self, whereas the component related to preparation “Make/Stuff” contained elements such as prepare, boil, smell and ceremony. Again, ketamine had the greatest overlap with NDEs in this type of analysis.

Other drugs that cause similar experiences to NDEs include LSD and N,N-Dimethyltryptamine (DMT). The famous hallucinogen LSD was as similar as ketamine to NDEs when the near-death event was caused by cardiac arrest. DMT is a hallucinogen found in South American plants and used in shamanistic rituals. It caused experiences like NDEs and is also made in the brain, leading to speculation that endogenous DMT may explain NDEs. It is not known, however, whether levels of DMT change in a meaningful way in the human brain near death, so its role in the phenomenon remain controversial.

This study has significant weaknesses because it is based on purely subjective reports—some taken decades after the event. Similarly, there is no way to substantiate the accounts in the Erowid collection as there is no way to prove that any individual took the drug they claimed or believed they were taking. This makes it all the more remarkable that a linguistic analysis of stories derived in this manner could discriminate among different drug classes in their similarities to NDEs.

Linking near-death experiences and the experience of taking ketamine is provocative yet it is far from conclusive that both are because of the same chemical events in the brain. The types of studies needed to demonstrate this hypothesis, such as measuring neurochemical changes in the critically ill, would be both technically and ethically challenging. The authors propose, however, a practical application of this relation. Because near-death experiences (NDEs) can be transformational and have profound and lasting effects on those who experience them, including a sense of fearlessness about death, the authors propose that ketamine could be used therapeutically to induce an NDE-like state in terminally ill patients as a “preview” of what they might experience, so as to relieve their anxieties about death. Those benefits need to be weighed against the risks of potential ketamine side effects, which include feelings of panic or extreme anxiety, effects that could defeat the purpose of the intervention.

More important, this study helps describe the psychological manifestations of dying. That knowledge may ultimately contribute more to alleviating fear of this inevitable transition than a dose of any drug.