Alan Turing committed suicide after being convicted for homosexuality. (Reuters photo)

Mathematician Alan Turing, whose cracking of a Nazi code helped the Allies to win World War Two but who committed suicide after being convicted for homosexuality, will appear on the Bank of England's new 50-pound banknote, the BoE said on Monday.

"As the father of computer science and artificial intelligence, as well as war hero, Alan Turing's contributions were far-ranging and path-breaking," BoE Governor Mark Carney, who took the final decision on the character selection, said.

"Turing is a giant on whose shoulders so many now stand."

Turing's electromechanical machine, a forerunner of modern computers, unravelled the Enigma code used by Nazi Germany and helped give the Allies an advantage in the naval struggle for control of the Atlantic.

His work at Bletchley Park, Britain's wartime code-breaking centre, was credited with shortening the war and saving many thousands of lives.

But he was stripped of his job and chemically castrated after being convicted of gross indecency in 1952 for having sex with a man. Homosexual sex was illegal in Britain until 1967.

Turing killed himself in 1954, aged 41, with cyanide. He was granted a royal pardon by Queen Elizabeth in 2013 for the criminal conviction that led to his suicide.

Rights campaigner Peter Tatchell, who campaigned for Turing's pardon and organised LGBT activists to vote for him in an early round of nominations for the banknote selection, said it was a breakthrough to have a known gay person appear on an English banknote for the first time.

"This is a much-deserved accolade for one of the greatest minds of the twentieth century," Tatchell said.

A 2014 film, "The Imitation Game", starring Benedict Cumberbatch as Turing, won an Oscar for best adapted screenplay.

In 2017, under new legislation known as "Turing's Law", Britain granted posthumous pardons to thousands of gay and bisexual men who were convicted of sexual offences under laws which have since been abolished

As well as an image of Turing, the new note will feature a table and mathematical formulae from a 1936 paper by Turing on computable numbers, an image of a pilot computer and technical drawings for the machines used to break the Enigma code.

The note will also include a quote by Turing about the rise of machine intelligence: "This is only a foretaste of what is to come, and only the shadow of what is going to be."

The 50-pound note is the BoE's highest-value banknote and is rarely used in daily transactions. The new note is expected to enter circulation by the end of 2021, the BoE said.