The $42 per share offer represents a premium of 27 percent to the upmarket grocery chain's Thursday close.
Whole Foods shares were halted at $32.77 in premarket trading, while Amazon's shares were up 0.5 percent at $969.
Excluding debt, the deal is valued at $13.39 billion, based on 318.9 million diluted shares outstanding as of April 9.
The grocer will continue to operate stores under the Whole Foods Market brand, the companies said.
John Mackey will continue as chief executive of Whole Foods, and the company's headquarters will remain in Austin, Texas.
Amazon and Whole Foods expect to close the deal during the second half of 2017.
(Reporting by Sruthi Ramakrishnan in Bengaluru; Editing by Saumyadeb Chakrabarty)