Records of Chelsea Pensioners who served in the British Army since 1760 have been published online.
The data gives service records, the kit each soldier was allotted, their illnesses, and reasons for discharge.
An ancestor of the Kray Twins, John Kray, who joined in 1870 and was jailed for desertion, is listed.
The records of 1.5 million soldiers held by the National Archives was published online by family history website findmypast.co.uk.
The servicemen were referred to as Chelsea Pensioners as their pensions were paid through the Royal Hospital at Chelsea.
The records give details about the soldiers' physical features, their next of kin, their occupation before joining the army, conduct and character.
John Kray - the son of Elizabeth Kray, who was the great-great-grandmother of the East End gangsters Ronnie and Reggie Kray - joined the 65th Regiment of Foot at the age of 17 years and 11 months and was discharged in 1889.
He served in the East Indies and Sudan and was given an Egyptian war medal and Khedive's Bronze Star 1884. But the soldier was convicted of desertion in 1879 and sentenced to jail and hard labour.
The record lists Victoria Cross winners and other interesting characters like 12-year-old Henry Timewell and the Three Day soldier.
John Henry Fry, 18, joined the army in 1888 but was discharged after a few days as he was thought "not likely to become an efficient soldier". But his service record notes his conduct as "good during his three days' service".
William Spencer, from The National Archives, said: "Technology will enable researchers to collect information about British Army soldiers in a new way and thereby improve the historians' understanding of who these men were, how and where they were recruited and where they served."
Debra Chatfield, marketing manager at findmypast.co.uk, said: "These records are a rich resource for family and militarily historians alike."
The scheme to digitise records contained in 6,300 boxes was the result of a three-year project between the National Archives, a genealogy organisation FamilySearch and the website findmypast.co.uk.