William and his wife Kate have three children: five-year-old Prince George, Princess Charlotte, four, and Prince Louis, who turned one in April.
Prince William is second in line to the throne after his father Prince Charles, with George third in line to become king.
His comments came during a visit to the Albert Kennedy Trust, a charity dedicated to helping young people made homeless due to their sexual orientation.
During a discussion with people being supported by the organisation, Prince William was asked how he would react if one of his children came out.
The Duke of Cambridge replied: "You really don't start thinking about that until you are a parent, and I think - obviously absolutely fine by me."
"The one thing I would be worried about is how they, particularly the roles my children fill, is how that is going to be interpreted and seen."