The domestic counter-intelligence and security agency came top of the annual Workplace Equality Index conducted by Stonewall, an LGBT rights charity.
It found the security service provided staff with quality employment policies, training, career development opportunities, and especially support for LGBT employees.
MI5 beat more than 400 organisations to top Stonewall's Top 100 Employers list for 2016, after coming seventh in 2015.
"Diversity is vital for MI5, not just because it's right that we represent the communities we serve, but because we rely on the skills of the most talented people whoever they are, and wherever they may be," said the agency's director-general Andrew Parker.
"This accolade from Stonewall is a great acknowledgement of the continued progress we have made over recent years in ensuring we draw on the widest possible pool of talent in our vital work."
Stonewall's workplace equality index uses a range of criteria and questions to establish employers' efforts to tackle discrimination against LGBT people, both in Britain and in their global operations.
Stonewall chief executive Ruth Hunt said: "Those organisations that are 'getting it right' are not only improving the lives of lesbian, gay, bi and trans staff, stakeholders, clients and customers, but are also reaping business benefits.
"We know that people perform better when they can be themselves, and it's been proven that diversity among staff leads to a more productive, positive and creative workplace environment."