At the 2012 United States Olympic Trials in Omaha, Nebraska, the U.S. qualifying meet for the Olympics, Anderson made the U.S. Olympic team for the first time by finishing sixth in the 200-meter freestyle with a time of 1:58.40, which qualified her to swim in the 4x200-meter freestyle as a member of the U.S. relay team. At the 2012 Summer Olympics in London, she swam for the winning U.S. team in the preliminary heats of the women's 4x200-meter freestyle relay and earned a gold medal. Anderson's sister, Haley, won a silver medal in the 10-kilometer open water marathon at the 2012 Olympics.