At 16, Fox made her acting debut in the 2001 film Holiday in the Sun, as spoiled heiress Brianna Wallace and rival of Alex Stewart (Ashley Olsen), which was released direct-to-DVD on November 20, 2001. In the next several years she guest-starred on What I Like About You and Two and a Half Men, as well as being an uncredited extra in Bad Boys II (2003). In 2004, she made her film debut in Confessions of a Teenage Drama Queen co-starring opposite Lindsay Lohan, playing the supporting role of Carla Santini, a rival of Lola (Lohan). Fox was also cast in a regular role on the ABC sitcom Hope & Faith, in which she portrayed Sydney Shanowski, replacing Nicole Paggi. Fox appeared in seasons 2 to 3, until the show was cancelled in 2006.
In 2007, Fox won the lead female role of Mikaela Banes in the 2007 live-action film Transformers, based on the toy and cartoon saga of the same name. Fox played the love interest of Shia LaBeouf's character Sam Witwicky. Fox was nominated for an MTV Movie Award in the category of "Breakthrough Performance", and was also nominated for three Teen Choice Awards. Fox had signed on for two more Transformers sequels. In June 2007, Fox was cast in a minor role in How to Lose Friends & Alienate People, starring alongside Jeff Bridges, Simon Pegg and Kirsten Dunst. She portrayed Sophie Maes, a love interest of Sydney Young (Simon Pegg). The film premiered on October 3, 2008, but was considered a box-office failure.In between Revenge of the Fallen and Dark of the Moon, Fox had her first lead role playing the title character in Jennifer's Body, written by Academy Award-winning screenwriter Diablo Cody. She played Jennifer Check, a mean-girl cheerleader possessed by a demon who begins to feed off the boys in a Minnesota farming town. The film was released on September 18, 2009, and co-stars Amanda Seyfried and Adam Brody.