In the past, celebrities who were gay would tend to keep to themselves, not wanting their personal life aired out for the public to have an opinion on. It was their private life and their private relationships, so what was it to anyone else? But when the 90s rolled around, famous actors and actresses started opening up and emerged from the confinement of the closet. Most famously was Ellen DeGeneres, who came out of the closet by way of her comedy series Ellen.

Since then, more actors have officially come out and have not been typecast for doing so and are welcomed by the public with open arms. Here are 20 straight characters who were played by actors so amazingly, we didn’t know they’re gay in real life.

20 Barney Stinson in How I Met Your Mother (Neil Patrick Harris)

Anyone who watched How I Met Your Mother knows that the character of Barney Stinson was a notorious ladies man who dated so much during the series, we lost count of all the women. In real life though, actor Neil Patrick Harris is happily married to actor David Burtka (who also starred on HIMYM) and they have two children.

19 Miguel Morez in General Hospital (Ricky Martin)

A lot of us forget that pop star Ricky Martin (who starred in The Assassination of Gianni Versace) was a soap star who played Miguel Morez on General Hospital. Martin has been open about being gay since the 2000s. He’s happily married to his husband of two years, Jwan Yosef and they have three children together.

18 Sheldon Cooper in The Big Bang Theory (Jim Parsons)

Fans of the comedy series The Big Bang Theory assumed that Sheldon Cooper (Jim Parsons) was more interested in science than he was any other person. Then he got a girlfriend. In real life, Parsons came out in 2012. A New York Times article noted he had been in a relationship for 10 years – though he was never really hiding it before.

17 Niles Crane in Frasier (David Hyde Pierce)

All throughout the series Frasier aired, a lot of fans thought that David Hyde Pierce was straight because his character Niles Crane was straight and in love with the character of Daphne Moon. In real life though, Pierce came out in 2007 who had been with now-husband Brian Hargrove for decades.

16 Juno in Juno (Ellen Page)

Ellen Page has been a darling for years ever since audiences fell in love with her as the sarcastic pregnant teenager Juno in Juno. Even though she officially came out in 2014, Page made the claim that Brett Ratner outed her long before she was ready to come out back when she was filming X-Men: The Last Stand.

15 George O’Malley in Grey's Anatomy (T.R. Knight)

T.R. Knight played the lovable Dr. George O’Malley, who was hopelessly in love with Meredith Grey (and then Izzy Stevens) in the medical drama Grey’s Anatomy. Knight officially came out of the closet when it was revealed that a costar called him a homophobic slur. He married his boyfriend Patrick B. Leahy in 2013.

14 Miranda Hobbes in Sex and the City (Cynthia Nixon)

Even though Cynthia Nixon is now a powerhouse politician and activist, she used to play the mellow lawyer Miranda Hobbes in HBO’s series Sex and the City. Her character had a casual style when it came to dating men even though she was an uptight New York lawyer. In real life, she has been married to her wife Christine Marinoni since 2012.

13 Lindsay Bluth in Arrested Development (Portia de Rossi)

Portia de Rossi, who made headlines when she married Ellen DeGeneres in 2008, played the self-centered former spoiled rich girl Lindsay Bluth in the Fox comedy series Arrested Development. Back in 2004, de Rossi was dating director Francesca Gregorini when a tabloid outed her to her family and then Ally McBeal costars.

12 Neal Caffrey in White Collar (Matt Bomer)

Actor Matt Bomer played numerous straight men in different roles up until his breakout role as con artist Neal Caffrey in White Collar on the USA Network. In 2011, he married publicist Simon Hall, a full two years before he actually came out to the media in 2014. The couple has three children together.

11 Sue Sylvester in Glee (Jane Lynch)

On the show Glee, Jane Lynch played Sue Sylvester, a straight P.E. teacher who was a thorn in everyone’s side. But in real life, Lynch has been out and proud for many years. She was even named one of Power Up’s “10 Amazing Lesbian Women in Showbiz” back in 2005.

10 Gaston in Beauty and the Beast (Luke Evans)

While the character of Gaston in the live version of Beauty and the Beast is a raging misogynist, the actor who plays him, Luke Evans, is far from it. Evans has been out his entire career and feels that it not has held him back from playing straight characters. However, he is notoriously private.

9 Darlene Conner in Roseanne (Sara Gilbert)

We grew up watching Sara Gilbert play the sarcastic Darlene Conner on Roseanne and then the sarcastic Leslie Winkle on The Big Bang Theory. While dating co-star Johnny Galecki in real life, she discovered that she was a lesbian and in 2001 began a relationship with producer Allison Adler. After that breakup, she married songwriter, Linda Perry.

8 Nearly Everyone In American Horror Story (Sarah Paulson)

Sarah Paulson has been a dominating figure in the American Horror Story world and usually plays straight characters on that show (in some of the seasons, that is) but in real life, Paulson has said that she dates who she falls in love with. Currently, it’s actress Holland Taylor (from Two and a Half Men fame).

7 Michael Scofield in Prison Break (Wentworth Miller)

Wentworth Miller hit the fame jackpot when he played the character Michael Scofield in the series Prison Break. In 2007, Miller actually denied the fact that he was gay in InStyle magazine and didn’t come out of the closet until 2013. In his younger years, he struggled with depression and has been vocal about it.

6 Clarice Starling in The Silence of the Lambs (Jodie Foster)

A romantic relationship was the absolute last thing on FBI agent Clarice Starling’s mind when she was attempting to track down an evil serial killer in The Silence of the Lambs. In real life though, actress Jodie Foster, who has been famously mum about her private life, came out in 2007 (officially though in 2013 when she addressed it at the Golden Globe Awards).

5 Spock in Star Trek (Zachary Quinto)

Zachary Quinto is known for playing the famous character of Spock in the Star Trek reboots and while his character is straight, Quinto himself came out as gay in 2011 and before then was an active supporter of gay rights and gay organizations. He’s been in a relationship with painter Miles McMillan since 2013.

4 Jesse St. James in Glee (Jonathan Groff)

Jonathan Groff usually finds himself playing a slew of straight characters (like Jesse St. James in Glee or Holden Ford in Mindhunter) but in reality, Groff has been out since 2009. He even dated Zachary Quinto for a brief time. In 2015, he was honored by the Point Foundation for being a “trailblazer” in the gay community.

3 Huck in Scandal (Guillermo Diaz)

In the drama series Scandal, the character of Huck was a ruthless assassin who happened to fall in love with a co-worker of his. Guillermo Diaz, the actor who played Huck has been openly gay his entire career in Hollywood. He was named one of OUT magazine’s “100 most influential gay, lesbian, bisexual, or transgender people” in 2013.

2 Frank Underwood in House of Cards (Kevin Spacey)

For almost his entire character, actor Kevin Spacey had been incredibly private about his personal life. Unfortunately, Spacey’s coming out was shrouded in controversy just a couple of years ago. The controversy got so bad that his character in Netflix’s House of Cards, Frank Underwood, had to be offed during the final season of the show.

1 Mike Brady in The Brady Bunch (Robert Reed)

Not a lot of people know that Robert Reed, who played the famous Mike Brady in The Brady Bunch, was gay in real life. He didn’t come out in his lifetime – it was co-star Florence Henderson who acknowledged it in 2000 when she said she regretted the decision to allow him to suffer in silence in an interview with ABC News.

References: people.com, instyle.com, vanityfair.com, huffingtonpost.com, instagram.com, out.com