The 31-year-old singer - who enjoyed chart success after shooting to fame on The X Factor in 2008 - was arrested in December 2016 following allegations over an incident at a hotel in Wolverhampton.
At Wolverhampton Crown Court on Thursday, he spoke only to confirm his name, date of birth and nationality as well as to deny the charge.
During a 36-minute hearing, co-defendant Jamien Nagadhana, 31, from Hounslow, London, denied assault by penetration in connection with the same incident.
Williams, of Croydon, south London, was granted unconditional bail until his trial on May 14 at the same court.
Judge Nicholas Webb told the defendants: “The position is this - your trial is now listed for May 14. Your bail will continue until that date.”
After the allegations came to light, Williams said he would be stepping back from charity work, adding: “Press speculation is likely to be unhelpful to the charities I work with.”
After leaving court, Williams posed for photos with fans and smiled for their cameras.
The popstar picked one child up for a selfie and laughed and joked with members of the public who recognised him.