The new law has been dubbed the "Alan Turing Law" after Britain's famous Enigma code-breaker responsible for decrypting Nazi messagesduring World War II who was granted a posthumous royal pardon in 2013 - 61 years after he was charged at a Manchester police station over homosexual activity.
The pardons were first announced last year as an amendment to the Policing and Crime Bill and were officially enforced as the Bill received Royal Assent today.
"We can never undo the hurt caused, but we have apologised and taken action to right these wrongs," said UK justice minister Sam Gyimah.
Statutory pardons will also be granted to people still living who apply to have their convictions removed.
More From This Section
The men were found guilty of committing now-abolished offences while in consensual relationships.
It will effectively act as an apology to those convicted for consensual same-sex relationships before homosexuality was decriminalised in England and Wales nearly 50 years ago.
Rachel Barnes, the great niece of Turing who has long campaigned on the issue, hailed the decision as "absolutely tremendous".
Her great uncle, known in the UK as the Bletchley Park code-breaker, was convicted in 1952 of gross indecency with a 19-year-old man.
His pardon followed a Private Member's Bill in the House of Commons.
In 2013, the posthumous royal pardoning of Turing led to calls for wider pardons, and the launch of a petition in 2015.
The petition gathered almost 640,000 signatories, including famous British actors Stephen Fry and Benedict Cumberbatch, who played Turing in the film about the enigma code, 'The Imitation Game'.
Around 75,000gayand bisexual men were convicted under the Sexual Offences Act, which was abolished in 1967, and around 16,000 are believed to be alive today.