Honda has announced that it will leave Formula One at the end of the 2021 season, ahead of the new technical regulations being adopted.