Alonso joined McLaren after winning the championship the past two years with Renault. He clashed with management and teammate Lewis Hamilton throughout the season, and finished behind champion Kimi Raikkonen of Ferrari and Hamilton.
"Since I was a boy I had always wanted to drive for McLaren, but sometimes in life things do not work out," Alonso said in a statement.
Alonso, who still has a two years left on his contract, reached an agreement that allows the driver to leave without penalty.
"(We) want to wish Fernando all the best for the future," McLaren team boss Ron Dennis said. "He is a great driver but for some reason the combination of (our team) and Fernando has not really worked out, and in the end we reached a stage where none of us could find a way to move forward."

Alonso has been linked with a possible return to Renault or a move to Williams or Red Bull.
Alonso had complained that as a world champion he deserved preferential treatment, and accused McLaren of favoring the 22-year-old rookie Hamilton. Dennis and Alonso didn't talk to each other for a period.