top of page

Alan Turing: Code Breaker, Computer Visionary, WW2 Hero, and Persecuted Gay Man That Died A Criminal

His genius embraced the first visions of modern computing and produced seminal insights into what became known as “artificial intelligence.” As one of the most influential code breakers of World War II, his cryptology yielded intelligence believed to have hastened the Allied victory.

But, at his death several years later, much of his secretive wartime accomplishments remained classified, far from public view in a nation seized by the security concerns of the Cold War. Instead, by the narrow standards of his day, his reputation was sullied.

On June 7, 1954, Alan Turing, a British mathematician who has since been acknowledged as one the most innovative and powerful thinkers of the 20th century — sometimes called the progenitor of modern computing — died as a criminal, having been convicted under Victorian laws as a homosexual and forced to endure chemical castration. Britain didn’t take its first steps toward decriminalizing homosexuality until 1967.

Only in 2009 did the government apologize for his treatment.

“We’re sorry — you deserved so much better,” said Gordon Brown, then the prime minister. “Alan and the many thousands of other gay men who were convicted, as he was, under homophobic laws were treated terribly.”

And only in 2013 did Queen Elizabeth II grant Turing a royal pardon, 59 years after a housekeeper found his body at his home at Wilmslow, near Manchester, in northwest England.

A coroner determined that he had died of cyanide poisoning and that he had taken his own life “while the balance of his mind was disturbed.”

At his side lay a half-eaten apple. Biographers speculated that he had ingested the poison by dousing the apple with cyanide and eating it to disguise the toxin’s taste. Some of those who studied his personality or knew him, most notably his mother, Ethel Turing, challenged the official verdict of suicide, arguing that he had poisoned himself accidentally.

To this day Turing is recognized in his own country and among a broad society of scientists as a pillar of achievement who had fused brilliance and eccentricity, had moved comfortably in the abstruse realms of mathematics and cryptography but awkwardly in social settings, and had been brought low by the hostile society into which he was born.

“He was a national treasure, and we hounded him to his death,” said John Graham-Cumming, a computer scientist who campaigned for Turing to be pardoned.

Above all, Turing’s name is associated for many people with the top-secret wartime operations of Britain’s code-breakers at Bletchley Park, a sprawling estate north of London, where he oversaw and inspired the effort to decrypt ciphers generated by Nazi Germany’s Enigma machine, which had once seemed impenetrable. The Germans themselves regarded the codes as unbreakable. At the time, German submarines were prowling the Atlantic, hunting Allied ships carrying vital cargo for the war effort. The convoys were critical for building military strength in Britain and eventually enabled the Allies to undertake the D-Day landings in Normandy in 1944, heralding the collapse of Nazi Germany the next year. Only by charting the submarines’ movements could Allied forces change the course of their convoys, and for that they relied on the cryptologists of Bletchley Park to decode messages betraying the Germans’ deployments.

Early on, Bletchley Park’s operations were hampered by a lack of resources, but pleas for better staffing were ignored by government officials. So, Alan Turing and several other codebreakers at Bletchley Park went over their heads to write directly to Prime Minister Winston Churchill. One of the codebreakers from Bletchley Park delivered the letter by hand in October 1941.

“Our reason for writing to you direct is that for months we have done everything that we possibly can through the normal channels, and that we despair of any early improvement without your intervention,” they wrote to Churchill [PDF]. “No doubt in the long run these particular requirements will be met, but meanwhile still more precious months will have been wasted, and as our needs are continually expanding we see little hope of ever being adequately staffed.”

In response, Churchill immediately fired off a missive to his chief of staff: “Make sure they have all they want on extreme priority and report to me that this had been done.”

The enduring fascination with Turing’s story inspired the 2014 movie “The Imitation Game,” starring Benedict Cumberbatch and Keira Knightley. But his scientific range went far beyond the limits of cinematic drama: He laid down principles that have molded the historical record of the relationship between humans and the machines they have created to solve their problems.

Turing and colleagues working on the Ferranti Mark I Computer in 1951. It was based on a prototype built five years earlier at the University of Manchester

Even before World War II, Turing was making breakthroughs.

Credit for the creation of the first functioning computer in 1946 went to the researchers John Presper Eckert and John W. Mauchly for their machine the Electronic Numerical Integrator and Computer, or Eniac, which they had developed at the University of Pennsylvania during World War II.

But Turing’s notions preceded the Eniac. He conceived what became known as the universal Turing machine, which envisioned “one machine for all possible tasks” — essentially computers as we know them today, Andrew Hodges, Turing’s biographer, wrote in a condensed version of his 1983 book, “Alan Turing: The Enigma.”

Turing’s vision, Hodges said, was that one machine could “be turned to any well-defined task by being supplied with the appropriate program.”

He added, “The universal Turing machine naturally exploits what was later seen as the ‘stored program’ concept essential to the modern computer: It embodies the crucial 20th century insight that symbols representing instructions are no different in kind from symbols representing numbers.”

Later, technology that emerged from the Manhattan Project, the United States-led effort to develop the atom bomb, also relied on Turing’s ideas.

“What had begun as a British idea was scaled up to industrial size by the Americans,” David Kaiser, a professor at the Massachusetts Institute of Technology, wrote in 2012 in The London Review of Books.

Turing’s postwar work at the University of Manchester, on the first functioning British computers, was also significant: It reflected the emerging power of electronic computing in the Cold War race for nuclear supremacy. And he remained fascinated by the interplay between human thought processes and their computerized inventions. Even in 1944, Hodges wrote, Turing had spoken to a colleague about “building a brain.”

In an article published in 1950 in the academic journal Mind, Turing developed a method that came to be known as the “Turing Test,” a sort of thought experiment to determine whether a computer could pass as a human. As part of his experiment, a human interrogator would ask questions and try to figure out whether the answers had come from a computer or a human.

Alan Mathison Turing was born in London on June 23, 1912, the second of two sons of Ethel Sara Stoney and Julius Mathison Turing, who had met in imperial India, where his father was a senior colonial administrator. After Alan’s birth they left him and his brother, John, in the care of foster parents in England while they returned to India so that Alan’s father could continue his work.

“Alan Turing’s story was not one of family or tradition but of an isolated and autonomous mind,” Hodges wrote.

Turing, front, in 1939 in Bosham, England, with a friend, Fred Clayton, rear. Between them are two Jewish fugitives from Germany whom Turing and Clayton helped.

In his early days, Turing’s education reflected the overwhelming social requisite of his class to secure a place at a reputable private boarding school. Alan, at age 13, enrolled at Sherborne School, in southern England, where his fascination with science raised alarms in an educational system based on the study of what were called the classics — works in Latin and ancient Greek.

“If he is to be solely a scientific specialist, he is wasting his time at a public school,” Nowell Smith, Sherborne’s headmaster, wrote to his parents, as recorded in Hodges’s book.

Nonetheless, he secured a place at King’s College in Cambridge to study mathematics, graduating in 1934 with a first class honours degree. With remarkable academic precocity he was made a fellow of the college in 1935. A year later, he published the groundbreaking paper “On Computable Numbers, With an Application to the Entscheidungsproblem” (or “decidability problem”), a reference in German to a celebrated riddle that the American logician Alonzo Church had also explained. Both Turing and Church reached the same conclusion — a basis for computer science — that there is no single algorithm that could determine the truth or falsity of any statement in formal logic (though Turing’s thinking was more direct).

Turing completed a doctoral thesis at Princeton in 1938 before returning to Cambridge. With Britain’s declaration of war on Germany in September 1939, he joined the Bletchley Park code breakers at the Government Code and Cypher School, working in makeshift huts clustered around a mansion. Their greatest initial challenge was figuring out the method of encryption of the German Enigma device, which was invented 20 years earlier by Arthur Scherbius, a German electrical engineer who had patented it as a civilian machine to encrypt commercial messages. The machine worked by entering letters on a typewriter-like keyboard and then encoding them through a series of rotors to a light board, which showed the coded equivalents. The machine was said to be capable of generating almost 159 quintillion permutations.

The British were helped initially by a Polish mathematician who had been studying the Enigma machine and had provided vital details after Hitler’s forces invaded Poland in 1939. But under the direction of Turing and another Cambridge-educated mathematician, W.G. Welchman, the Bletchley Park code breakers greatly expanded and accelerated those early efforts. Using a huge contraption called the Bombe, they mimicked the operations of the Enigma machine to break its codes.

“The critical factor was Turing’s brilliant mechanization of subtle logical deductions,” the biographer Hodges wrote. In 1942, Turing was assigned to visit the United States for several months of high-level consultations on the encryption of conversations between President Franklin D. Roosevelt and Winston S. Churchill. His wartime work earned him a high civilian award, and he was named an Officer of the Most Excellent Order of the British Empire. In the postwar years, Turing’s fascination with computers led him to design the Automatic Computing Engine. Although it was never built, Turing believed that “the computer would offer unlimited scope for practical progress toward embodying intelligence in an artificial form,” Hodges wrote.

In October 1948, Turing began working at Manchester University’s computing laboratory. He bought a house in nearby Wilmslow in 1950. Among his enthusiasms were his work on various scientific themes, including morphogenesis, the theory of growth and form in biology; his continued secret ties to Britain’s postwar code breakers; and long-distance running. He was also, Hodges said, beginning to explore the homosexual identity he had hidden when he proposed marriage in 1941 to Joan Clarke, a Bletchley Park cryptanalyst. He later withdrew the offer after explaining his sexuality to her, and the two remained friends.

About 10 years later, the police were investigating a burglary at his home when he admitted to having had a physical relationship with a man named Arnold Murray. Murray told Turing that he knew the thief’s identity, and detectives, in their questioning, asked Turing about his relationship to Murray. In March 1952, Turing and Murray were charged with “gross indecency,” and both pleaded guilty in court. Murray was given a conditional discharge, but Turing was ordered to undergo chemical castration by taking doses of the female hormone estrogen to reduce sex drive.

Two years later, the motive for his apparent suicide, at age 41, remained unclear and left many questions. There is still a bit of mystery surrounding Turing’s death, Turing died of cyanide poisoning, in what is widely believed to have been a suicide. His life had been turned upside down by his arrest. He lost his job and his security clearance. By order of the court, he had to take hormones intended to “cure” his homosexuality, which caused him to grow breasts and made him impotent. But not everyone is convinced that he died by suicide.

In 2012, Jack Copeland, a Turing scholar, argued that the evidence used to declare Turing’s death a suicide in 1954 would not be sufficient to close the case today. The half-eaten apple by his bedside, thought to be the source of his poisoning, was never tested for cyanide. There was still a to-do list on his desk, and his friends told the coroner at the time that he had seemed in good spirits. Turing’s mother, in fact, maintained that he probably accidentally poisoned himself while experimenting with the chemical in his home laboratory. (He was known to taste chemicals while identifying them, and could be careless with safety precautions.)

That line of inquiry is far more tame than some others, including one author’s theory that he was murdered by the FBI to cover up information that would have been damaging to the U.S.

Turing was only one of the many men who suffered after being prosecuted for their homosexuality under 19th-century British indecency laws. Homosexuality was decriminalized in the UK in 1967, but the previous convictions were never overturned. Turing’s Law, which went into effect in 2017, posthumously pardoned men who had been convicted for having consensual gay sex before the repeal. According to one of the activists who campaigned for the mass pardons, around 15,000 of the 65,000 gay men convicted under the outdated law are still alive.

“Eccentric, solitary, gloomy, vivacious, resigned, angry, eager, dissatisfied — these had always been his ever-varying characteristics,” Hodges wrote, “and despite the strength that he showed the world in coping with outrageous fortune, no one could safely have predicted his future course.”

Andrew Hodges, Turing’s biographer