The 31-year-old revealed she suffers from Sjogren's syndrome, an autoimmune disorder that presents with many symptoms including joint pain.
Sjogren's disease has often been called the mystery illness. The signs mimic other illnesses, which often confuses doctors.
Williams said on Thursday's "Good Morning America" that the diagnosis cleared up a lot of concern.
"It's a huge relief because as an athlete, everything is physical for me. Everything is being fit and being in shape," she said.
She said four years ago, she was misdiagnosed with exercise-induced asthma. Her story is quite common. On average, it takes six years for a person to get a diagnosis.
Symptoms affect every area of the body. Moisture glands shut down, resulting in dry eyes and eye infections. There are neurological problems, such as loss of concentration and memory, as well as upset stomach numbness, tingling in the extremities and breathing issues, which is something Williams suffered.
"I lost a lot of feel, like I would miss shots by feet, and I just couldn't feel my hands, and my hands would hurt when I was playing," she said.
Sjogren's is not curable, but it can be treated. Between one and four million people live with Sjogren's - nine out of 10 are women.
Williams said she now feels like she can get better and move on.