Barlow announced yesterday that he and wife Dawn had lost their baby Poppy after she was delivered stillborn on Saturday (August 4).
Williams wished his friend and Take That bandmate well during their difficult time in his blog earlier today.
"My thoughts are with Gary, Dawn and family right now x", he wrote.
Tulisa Contostavlos added: "My thoughts & prayers are with @GBarlowOfficial and wife dawn tonight. Heartbreaking x"
One Direction's Harry Styles also paid tribute, tweeting: "My Love, thoughts and prayers are with @GBarlowOfficial and his family at such a difficult time.. .xx".
Peter Andre wrote: "So incredibly sorry to hear about Gary Barlow and family . My families thoughts are with you all."
Gary and Dawn, who married in 2000, welcomed their third child Daisy in 2009. The pair are also parents to Daniel, 12, and Emily, 10.