Around 1.5 million people in England and Wales identified as having an LGB+ sexual orientation in the 2021 census: 3.2% of those aged 16 and over, the figures show.
And 262,000 people said their gender identity was different from their registered sex at birth, the Office for National Statistics (ONS) said.
This represents 0.5% of the population aged 16 and over.
Data from the 2021 census for England and Wales is released in stages over two years.
It is the first time that figures on sexual orientation and gender identity have been included, and people over the age of 16 are asked to provide this information voluntarily.
In general, 45.7 million (94.0%) of the population aged 16 and over answered the question on gender identity, and 44.9 million people (92.5%) answered the question on sexual orientation.
Of the 262,000 people who said their gender identity was different from their registered sex at birth, 118,000 did not provide further details.
Some 48,000 (0.1% of the population aged 16 and over) identified as trans male and 48,000 (0.1%) identified as trans female.
A total of 30,000 identified as non-binary, while another 18,000 people wrote with a different gender identity.
When asked about their sexual orientation, 43.4 million people (89.4% of the population aged 16 and over) identified as straight or heterosexual.
Some 748,000 (1.5%) described themselves as gay or lesbian, 624,000 (1.3%) as bisexual, and 165,000 (0.3%) selected “Other sexual orientation.”
Of those who selected the latter category, the most common responses included: pansexual (112,000, 0.23%), asexual (28,000, 0.06%), and queer (15,000, 0.03%).
ONS director Jen Woolford said the first census estimates were “crucial” and added: “They will ensure decision-makers have the best information so they can better understand the extent and nature of disadvantages people may face.” be experiencing in terms of educational, health, employment and housing outcomes.
“This is just the first snapshot. In future analyses, we will explore sexual orientation and gender identity by key demographic variables, such as age and sex, as well as employment, health, education, and ethnicity, among others.”
London was the region within England with the highest percentage of people who said their gender identity was different from their registered sex at birth (0.91%).
The capital also had higher proportions of people identifying as trans men (0.16%) and trans women (0.16%) compared to England and Wales.
It was also the region with the highest proportion of people identifying with an LGB+ orientation (4.3%), while the local authority with the highest percentage was Brighton and Hove (10.7%).
The Stonewall charity said the release of data on sexual orientation and gender identity in the census “means our country knows itself a little better today.”
Executive Director Nancy Kelley said: “Over the past two centuries of data collection through our national census, LGBTQ+ people have been invisible, with the stories of our communities, our diversity and our lives missing from the national record.
“Today is a historic step forward after decades of Stonewall’s campaign to record sexual orientation and gender identity in the census, finally painting an accurate picture of the diverse ‘Rainbow Britain’ in which we live now, where more and more of us are proud to be who we are.”