The 35-year-old announced the move on social media, saying it was not “an easy decision” but “after listening to my body” and discussing it with his team he said it was “the right decision”.
“The fact that there has only been two weeks between RG (French Open) and Wimbledon, didn’t make it easier on my body to recuperate after the always demanding clay court season.
“They have been two months of great effort and the decision I take is focused looking at the mid and long term.”
The double Olympic champion was seen to be struggling physically towards the end of his loss to Novak Djokovic in the semi-finals at Roland Garros.
Nadal won gold in singles in Beijing Olympics in 2008 and in doubles with Marc Lopez in Rio in 2016, when he also carried Spain’s flag in the opening ceremony.
The 20-time grand slam tennis champion said “I want to send a special message to my fans around the world, to those in the United Kingdom and Japan in particular.
“The Olympic Games always meant a lot and they were always a priority as a sports person, I found the spirit that every sports person in the world wants to live.
“I personally had the chance to live three of them and had the honour to be the flag bearer for my country.”
Rafael Nadal will be replaced as third seed at Wimbledon by Greek tennis player Stefanos Tsitsipas.