The Ministry of Defence is now asking all new recruits to the armed forces whether or not they are gay.
The Ministry says this has been introduced in order to improve diversity in the military, and recruits have the option to "prefer not to say".
Recruits will also have the opportunity to say how comfortable they feel about being open about their sexual orientation.
Data collected by the Ministry would remain anonymous.
A spokesman said: "The MoD proudly encourages diversity at all levels. Service personnel are now encouraged to declare their sexual orientation.
"Although this is not mandatory, collecting this data will give us a better understanding of the composition of our armed forces and help ensure our policies and practices fully support our personnel."
Openly gay servicemen and women have been allowed to serve since 2000.