Williams suffered an ankle injury during an accidental collision in training on Wednesday and will be replaced by Leigh Halfpenny, pictured, in one of three changes to the side that started the quarter-final against France.
Naming his side on Friday, Gatland confirmed that Jonathan Davies had recovered from the knee injury which forced him to miss the victory over Les Bleus.
Wales had already lost back-row forward Josh Navidi, whose tournament is over after tearing a hamstring against France. His place at No 8 goes to Ross Moriarty.
Halfpenny, 30, who missed the 2015 tournament through injury, is a vastly experienced replacement for Williams, having won 84 caps.
The 28-year-old Williams had been bidding to add to the three titles he has collected this year. He won the European Champions Cup and English Premiership with Saracens and completed the Six Nations Grand Slam with Wales.
Wales
1. Wyn Jones
2. Ken Owens
3. Tom Francis
4. Jake Ball
5. Alun Wyn Jones (captain)
6. Aaron Wainwright
7. Justin Tipuric
8. Ross Moriarty
9. Gareth Davies
10. Dan Biggar
11. Josh Adams
12. Hadleigh Parkes
13. Jonathan Davies
14. George North
15. Leigh Halfpenny
Replacements:
16. Elliot Dee
17. Rhys Carre
18. Dillon Lewis
19. Adam Beard
20. Aaron Shingler
21. Tomos Williams
22. Rhys Patchell
23. Owen Watkin