Alan Turing: Code Breaker, Computer Visionary, WW2 Hero, and Persecuted Gay Man That Died A Criminal
- Jun 7, 2023
- 16 min read
Updated: 3 hours ago

In 1952, a British court gave Alan Turing a choice: prison or chemical castration. He chose the hormones. Two years later he was dead, a half-eaten apple on the bedside table. He was 41.
This is a man who had helped crack the Enigma code, built the theoretical foundations of modern computing, and contributed to shortening World War II by what historians estimate was two years or more. The state that benefited from all of that then prosecuted him for having a consensual relationship with another man, stripped him of his security clearance, subjected him to hormone injections that caused his body to develop breasts, and watched him deteriorate until he died.
The story of Alan Turing is one of the most extraordinary and appalling in British history, and it still isn't told often enough without the film-friendly softening that tends to smooth away the genuine horror of what happened to him.

A Mind That Didn't Fit
Alan Mathison Turing was born in London on 23 June 1912. His parents were frequently in India on colonial service, so he and his brother were largely raised by English boarding schools. At Sherborne in Dorset, he was the kind of student headmasters didn't know what to do with: completely uninterested in the Latin and Greek that the school valued, and privately brilliant at the mathematics and science that it barely acknowledged. His headmaster wrote that if Turing intended to be a scientist, he was wasting everyone's time at a public school. Turing ignored him and kept going.
At Sherborne he became close to a fellow student named Christopher Morcom, widely regarded as his first love. Morcom was sharp, kind, and shared Turing's passion for mathematics and astronomy. When Morcom died suddenly in February 1930 from complications of bovine tuberculosis, Turing was devastated. He threw himself deeper into the work they'd shared, and by his own account spent years working as though Morcom were still watching. The loss shaped him in ways that ran through the rest of his life, including his later fascination with questions of consciousness, mind, and whether thought could survive the body that produced it.
In a letter to Frances Isobel Morcom, Christopher’s mother, Turing expressed his feelings candidly:
"I am sure I could not have found anywhere another companion so brilliant and yet so charming and unconceited. I regarded my interest in my work, and in such things as astronomy (to which he introduced me) as something to be shared with him and I think he felt a little the same about me ... I know I must put as much energy if not as much interest into my work as if he were alive, because that is what he would like me to do."

Turing maintained a warm and respectful correspondence with Mrs Morcom long after Christopher’s passing. She would send him gifts, and he would write to her, particularly to mark Morcom’s birthday. On the eve of the third anniversary of Morcom’s death, Turing wrote tenderly to her:
"I expect you will be thinking of Chris when this reaches you. I shall too, and this letter is just to tell you that I shall be thinking of Chris and of you tomorrow. I am sure that he is as happy now as he was when he was here. Your affectionate Alan."

By 1931 he was at King's College Cambridge, tearing through mathematics at a pace that made his peers take notice. He was made a fellow in 1935. The following year he published a paper called On Computable Numbers, which described a hypothetical machine that could solve any problem expressible in logical steps. It was abstract, theoretical, and completely foundational. That machine is now called a Turing machine. It's the conceptual ancestor of every computer that has ever existed.
Bletchley and the Bombe
When war came in 1939, Turing went straight to Bletchley Park, the Victorian mansion in Buckinghamshire that served as Britain's codebreaking headquarters. The problem they were trying to crack was Enigma, a German encryption machine that scrambled messages through a system of rotors, plugboards, and wiring into something approaching 159 quintillion possible settings per message. The Germans changed the settings daily. They were confident it was unbreakable.
Turing's contribution was the Bombe, an electromechanical device that drastically reduced the number of possible Enigma settings that needed to be tested, making daily decryption achievable. He built on earlier work by Polish mathematicians who had analysed captured Enigma machines before the war, and developed it into something that could actually be scaled and run operationally.

By mid-1940, German Luftwaffe signals were being read at Bletchley. Turing then turned to naval Enigma, which was more complex and which he later described as something he took on partly because nobody else was doing anything about it.
The impact on the war was immediate and significant. With Enigma signals being read in near-real time, the Royal Navy could track U-boat wolfpacks and reroute convoys before they sailed into ambush. It kept Britain supplied with American arms, food, and fuel at a period when the Atlantic was genuinely close to being lost. Later, Ultra intelligence fed into the planning for D-Day, giving commanders reliable information about German troop movements and fortifications that would have otherwise cost thousands of additional lives to discover the hard way.

The scale of the contribution is still debated, but the Imperial War Museum estimates that Bletchley's codebreakers shortened the war by several years. Some historians put the figure at two to four. What that translates to in lives is genuinely difficult to calculate, but the numbers cited run into the millions.

The operation only worked because of the people running it. Bletchley was a strange place, part country manor, part makeshift village, with huts hastily built on the lawns as the workforce expanded. It attracted an unusual cast: chess champions, classicists, crossword enthusiasts recruited from the pages of The Times, and mathematicians who were better with problems than with small talk. Dilly Knox, an eccentric classics scholar, had been cracking codes since World War I and was known for working in his bath. Joan Clarke was one of the very few senior female cryptanalysts, handling some of the trickiest elements of the Enigma problem. Hugh Alexander, a chess champion, led Hut 8 after Turing and kept the momentum going as the war went on.
Hundreds of young women from the Women's Royal Naval Service, the Wrens, kept the Bombes running through night shifts, feeding punched tapes into the machines and taking down decrypted messages. The atmosphere was a peculiar mix of academic eccentricity and high-stakes urgency, with tea breaks, cryptic Christmas cards, and occasional dances at the main house sitting alongside work that could decide the outcome of battles.
Turing himself contributed a few personal touches to the environment. He hated people borrowing his mug, so he drilled a hole in the handle and chained it to a radiator pipe in Hut 8. He suffered badly from hay fever on his daily cycle commute and solved the problem by wearing a World War I gas mask while pedalling. These are small details, but they capture something true about the man: practical, slightly outside normal social conventions, and entirely focused on whatever problem was in front of him.

When Turing and his colleagues found themselves blocked by Whitehall bureaucracy over resources, they went straight to the top. In October 1941 they wrote directly to Winston Churchill, asking him to intervene. Churchill's response was characteristically direct. He wrote to his Chief of Staff: "ACTION THIS DAY: Make sure they have all they want on extreme priority and report to me that this has been done." Bletchley got what it needed.
Inside Bletchley Park: Eccentricity, Genius and Wartime Secrets
For anyone expecting a regimented military camp, Bletchley Park was a surprise. It was a curious blend of country manor and makeshift village, with its big main house and a sprawl of draughty huts and brick blocks hastily built on the lawns as the operation grew. Each hut had its own atmosphere, some buzzing like beehives, others quiet except for the scratching of pencils and the rattle of typewriters.
Inside, the codebreakers, known as “the Boffins”, and hundreds of support staff worked in shifts around the clock, seven days a week. People called it the “Golf Club” or the “Country House” to keep up appearances when asked by nosy friends what they were doing for the war effort. In truth, Bletchley was one of the most secretive and intense workplaces in Britain.
Tea, Cigarettes and Ciphers
It was not exactly glamorous. The huts were freezing in winter, stifling in summer and often smelled of stale tobacco and damp coats. Yet the atmosphere was electric with ideas. Young women from the Women’s Royal Naval Service, the Wrens, operated the Bombes, fed punched paper tapes into clattering machines, and took down streams of decrypted messages for senior officers to analyse.
In break rooms, people fuelled themselves on endless mugs of tea, jam sandwiches, chocolate and cigarettes. Social lives were strange and spontaneous. If you fancied a dance, you might find a piano in the main house or join a staff dance in the dining hall. Romance did blossom among the huts, though everyone knew loose talk could sink ships, or, more likely, ruin months of delicate work.
A Cast of Brilliant Characters
While Alan Turing remains the poster boy for Bletchley Park today, he was surrounded by a cast of remarkable minds:



Then there were the so-called “Debs of Bletchley”, bright young debutantes who had been roped in for their linguistic skills or quick minds. Many of them never dreamed they’d be trusted with secrets that could decide battles and save thousands of lives.
Small Wonders: The Quirks and Daily Life of Bletchley Park
While Bletchley Park was serious work, it was also a place full of odd habits, eccentric genius and the occasional outright silliness, necessary antidotes to the mental strain of fighting a secret war armed with pencils and machinery.
Cycling with a Gas Mask
Another Turing quirk was his daily cycle commute. He pedalled from his lodgings to Bletchley, cutting a solitary figure on country lanes. He suffered terribly from hay fever but refused to let it slow him down, so he wore a World War I gas mask while cycling, turning heads and no doubt giving the local milkmen something to talk about.
Cryptic Christmas Cards
Every Christmas, the Bletchley Park staff looked forward to special cards: cryptic puzzles and riddles slipped into festive envelopes by the senior cryptanalysts. Solving them became an unofficial contest that spread from hut to hut. It was a gentle reminder that, in this world, cracking codes wasn’t just deadly serious, it was a sport and a passion.
The Piano in the Mansion
At the heart of the old main house, there stood a well-used piano. After a long shift hunched over the Bombes or poring over ciphertexts, people would gather around it. Some nights it was cheerful singalongs; other times, after news of a torpedoed convoy, it was sombre tunes to soothe frayed nerves.
A Bit of Cross-Dressing
Bletchley Park was surprisingly tolerant of eccentricities that might have raised eyebrows elsewhere. It was whispered that one staff member sometimes showed up to night shifts in women’s clothing, and no one particularly minded. Results mattered more than appearance.
Spies on the Inside
Security was strict, but leaks still happened. German spies did manage to get scraps of information about Bletchley’s activities, though ironically, the Nazis were so convinced Enigma was unbreakable that they often ignored their own agents’ warnings.
The Wrens’ Tales
The young women of the Women’s Royal Naval Service (the Wrens) did a huge share of the shift work, keeping the Bombes running through the small hours. Many later described it as an odd mix of boredom and adrenaline: long stretches listening to the machines hum and click, broken by sudden moments when a decrypted message came through, a real glimpse into the enemy’s mind.
A Legacy in Oddities and Triumph
When Alan Turing chained his mug to a radiator, wore a gas mask on his bike or puzzled through the night while munching an apple, no one realised history was being rewritten in these small, peculiar scenes. Today, visitors to Bletchley Park can still see reconstructed huts, old Bombes whirring in demonstration, and even Turing’s mug, a reminder that sometimes, world-changing ideas start with a few brilliant misfits, endless tea, and a willingness to think differently.
Secrets Carried for Decades
One of the strangest aspects of Bletchley Park is how invisible it remained after the war. Most staff simply packed up, signed the Official Secrets Act and went back to ordinary jobs, teachers, librarians, civil servants. Some didn’t even tell their families for fifty years that they’d helped win the Battle of the Atlantic or lay the groundwork for D-Day.
Alan Turing, of course, never got to tell his full story. His breakthroughs in computing and artificial intelligence were overshadowed by how Britain betrayed him. It wasn’t until the 1970s that historians began to piece together just how crucial the codebreakers had been, and how much we all owe to that little cluster of huts hidden in the Buckinghamshire countryside.
A Secret War, A Private Life
Even as Alan Turing was helping crack the ciphers that sped up Hitler’s downfall, he was fighting a more personal battle that Britain was nowhere near ready to win. By the conservative standards of mid-twentieth-century Britain, being gay was a crime, not just frowned upon but actually illegal under Victorian-era laws that hadn’t evolved with the times.
Turing knew exactly what he risked by being open about his true self. To the outside world, he was a mild-mannered, slightly oddball bachelor whose mind was always off somewhere in the clouds of mathematics and machinery. Behind closed doors, though, he was a man longing for the same simple companionship that his heterosexual peers could enjoy without fear.
One of the more touching chapters in this hidden side of Turing’s life is the story of Joan Clarke. Joan wasn’t just a talented cryptanalyst at Bletchley Park, she was Turing’s intellectual equal in many ways, a rare female mathematician at a time when women were largely funnelled into clerical roles.

The pair grew close, sharing jokes, chess puzzles and long hours bent over cipher sheets.
In 1941, in an attempt to conform to the social expectations he could never truly inhabit, Turing proposed marriage to Joan. She accepted, perhaps out of affection and perhaps because, in that cloistered world of secrecy, companionship was precious. But honesty got the better of him. Turing gently told her about his sexuality and broke off the engagement before they could walk down the aisle.
Remarkably, Joan didn’t turn away from him, she remained his loyal friend for the rest of his life, a rare ally when others looked the other way.
After the war, when the secrets of Bletchley Park were packed away and everyone went back to “normal life”, Turing turned his restless mind to a new frontier, building machines that could mimic thought itself. At the University of Manchester, he helped construct the Mark I and Mark II computers, primitive by our standards but astonishing for their day.
He took things further in 1950 when he published Computing Machinery and Intelligence in the journal Mind. There, in a few brisk pages, he posed a question that still fuels debates about artificial intelligence today: if a machine can answer our questions in a way that’s indistinguishable from a human, can we say it “thinks”? This elegant thought experiment became known as the Turing Test, an idea so ahead of its time that it still shapes how we talk about chatbots and algorithms today.
Criminalised and Broken
But Britain in the 1950s had little patience for a man who defied its moral code, no matter how many lives he had saved.
In 1952, a small domestic drama upended his world. A young man named Arnold Murray, with whom Turing had formed a romantic relationship, let slip the name of a petty thief who had burgled Turing’s house. When police arrived to investigate, their interest veered quickly from the burglary to Turing’s private life.
It didn’t take much for the authorities to bring charges of “gross indecency”, the same archaic law that had destroyed Oscar Wilde half a century earlier. Turing could have tried to lie or mount a legal fight, but he refused. In the same blunt honesty that had cost him his engagement to Joan Clarke, he admitted the truth in court.

The consequences were cruel. Rather than jail, the court ordered Turing to undergo chemical castration, a grim experiment in forced “treatment” for homosexuality. He was given oestrogen injections that sapped his libido, altered his body chemistry and, humiliatingly, caused gynaecomastia, the development of breast tissue.
It was a catastrophic blow to his well-being. Turing, once an avid long-distance runner who had competed against Olympic-level athletes, found his strength fading and his body changing in ways he neither wanted nor understood. The British government also stripped him of his security clearance. The man who had once been trusted with the country’s most sensitive secrets was now deemed unfit to serve, all because of who he loved.
By June 1954, his isolation was near complete. He kept himself busy with experiments in his home lab in Wilmslow, playing with chemicals and electronics, distractions from the ruin of a career and the public shame.
On 7 June, he was found dead in his bed. A coroner declared it suicide by cyanide poisoning, pointing to a half-eaten apple on his bedside table. Legend has it he dipped the apple in cyanide to mask the taste, a quiet nod, some say, to his favourite fairy tale: Snow White and the Seven Dwarfs.
Yet, as with so much in Turing’s life, even this ending is clouded by ambiguity. His mother, Ethel, and several friends believed it was accidental, he often handled cyanide carelessly in his home lab and had been in good spirits, with a to-do list waiting on his desk. Some have gone further, spinning conspiracies that the government silenced him to protect Cold War secrets.
Whatever the truth, one fact remains: Alan Turing, the brilliant, eccentric mind who reshaped our technological age and helped win the Second World War, died condemned by the very country he had so loyally served. His quiet private battles only came to light years later, a tragic lesson in how genius and difference were too easily betrayed by prejudice.
A Long Overdue Apology — and a Legacy That Refuses to Fade
For decades after his death, Alan Turing’s name was known only to a select few in academia and the intelligence community. His wartime contributions remained buried under the Official Secrets Act until the 1970s, when historians finally began to piece together how decisive his codebreaking work had been in defeating the Nazi U-boat menace and clearing the way for D-Day.
By the time the general public learned what Bletchley Park had achieved, and what Turing had sacrificed, it was too late to apologise to the man himself. But a slow, collective sense of shame grew in Britain as people came to understand the cruelty he had suffered simply for loving who he loved.
It wasn’t until 2009, fifty-five years after Turing’s lonely death, that a formal apology finally came. Gordon Brown, then Prime Minister, issued a statement:
“Alan and the many thousands of other gay men who were convicted, as he was, under homophobic laws were treated terribly. On behalf of the British government, and all those who live freely thanks to Alan’s work, I am very proud to say: we’re sorry — you deserved so much better.”
Four years later, in 2013, Queen Elizabeth II granted Turing a posthumous royal pardon, symbolically erasing the “crime” for which he had been punished. Campaigners didn’t stop there. They fought to ensure that other men who had suffered under the same law were also acknowledged. The result was what’s now known as “Turing’s Law,” which came into effect in 2017 and retroactively pardoned thousands of men convicted of consensual same-sex relationships before homosexuality was decriminalised in 1967.
The pardon is complicated. Some have pointed out, reasonably, that a pardon implies wrongdoing being forgiven, when what actually happened was that Turing was convicted under a law that should never have existed. Andrew Hodges himself said the pardon didn't embody any sound legal principle, and that a more meaningful action would have been releasing the still-classified files on Turing's postwar work for GCHQ.
A Name Etched Into Our Digital Age
Today, Alan Turing’s story is no longer hidden in dusty files. Bletchley Park has become a museum and memorial to all the quiet heroes of that secret war, visitors can see the reconstructed Bombe machines, step inside the same draughty huts, and sense how close the world came to a very different outcome.
Turing himself has been celebrated in statues, stamps, biographies and film. The Imitation Game (2014), starring Benedict Cumberbatch and Keira Knightley, dramatised his life for millions who might never have heard his name otherwise. While the film took some liberties, it cemented Turing in the public imagination as a tragic genius who deserved far more kindness in his own time.
In the scientific world, his legacy is even stronger. Computer science students the world over learn about Turing machines and the Turing Test. His name adorns the most prestigious prize in computing, the A.M. Turing Award — the tech world’s equivalent of a Nobel Prize. His ideas about artificial intelligence continue to shape debates about how far machines can — or should — mimic the human mind.
For the LGBTQ+ community, Turing’s story stands as a reminder of how brilliance and courage can be crushed by bigotry, but also how public attitudes can change, however slowly. His life is a cautionary tale and a point of pride: a way to honour those who paid the price for being themselves long before it was safe to do so.
More Than a Codebreaker
In the end, Alan Turing was so much more than the codebreaker who outwitted Enigma. He was a visionary who glimpsed a future where machines could reason, learn and even converse with us, and a man who, despite being let down by the country he helped to save, remained defiantly true to himself.
He left behind no children, no memoirs, no grand speeches, just pages of dense, elegant mathematics and stories of a quiet oddball who chained his mug to a radiator, cycled with a gas mask and, with a handful of colleagues in a cold hut, cracked the code that changed the course of history.
Today, every algorithm, every conversation about artificial intelligence, every modern computer, every encrypted communication traces a line back to work that Turing either did or made possible. The iPhone in your pocket is, at some level of abstraction, a descendant of the machine he described in a 1936 paper. He didn't live to see any of it.











