The Australian winger moves up from the Championship to become the Cottagers' second signing of deadline day, following the addition of Pavel Pogrebnyak
The 18-year-old is a product of the Pompey academy and signs a two-and-a-half-year deal with the London club.
Wiliams made six appearances for the Portsmouth first-team this season, after making his debut against his brother Rhys in a 2-2 draw against Middlesbrough.
On Monday, Williams enjoyed a run-out for his new club's reserve team as they beat Wolves 1-0 at Telford.
Portsmouth boss Michael Appleton believes that joining Martin Jol's Cottagers was a prospect the youngster couldn't turn down.
He told the club's official website: "This is a good opportunity for Ryan to move to an established Premier League outfit and we wish him all the best for the future.”