Farmer was born in Jersey City, New Jersey, in 1957. He attended Georgetown University receiving a B.A. degree in 1979 and a J.D. degree in 1986. After law school he worked as a clerk for New Jersey Supreme Court Justice Alan B. Handler. From 1988 to 1990, he was an associate in the law firm of Riker, Danzig, Scherer, Hyland & Perretti in Morristown. From 1990 to 1994 he was an Assistant U.S. Attorney for the District of New Jersey.
In 1997, Governor Christine Todd Whitman appointed Farmer as Chief Counsel, after having served as Deputy Chief Counsel and Assistant Counsel to the Governor.
Farmer was nominated to be New Jersey Attorney General on March 15, 1999, and was sworn in the following June after being confirmed unanimously by the New Jersey Senate. He continued to serve under Donald DiFrancesco after Whitman's resignation.
Farmer served as Acting Governor for 90 minutes. Following Governor Christine Todd Whitman's resignation the previous year to become head of the EPA, Farmer was one of four people to serve as acting governor for the one-year period between Whitman's resignation and Jim McGreevey's inauguration, along with three different senate Presidents (Donald DiFrancesco, John O. Bennett, and Richard Codey). DiFrancesco served as acting governor for all but the last week of this period, until his term as senate President ended on January 8, 2002. At the end of DiFrancesco's tenure as Governor of New Jersey, the state did not have the position of lieutenant governor, and succession rules specified that the next in line for governor after the Senate President would be the Attorney General -- Farmer -- until the next Senate President could be sworn in. Bennett and Codey, the Senate Co-Presidents, then divided the last week of the term among them as Governor, with Bennett serving from January 8, 2002 to January 12, 2002; and Codey serving from January 12, 2002, to January 15, 2002. As a result, the state had five different people serving as governor during a period of eight days.
On January 21, 2010, he appeared on The Colbert Report.
In July 2011 he was appointed the 13th (and tie-breaking) member of New Jersey's Congressional Redistricting Commission by both its Democratic and Republican members. New Jersey lost one Congressional seat in redistricting and the panel redraw the congressional districts, determining which seat was lost.
On April 11, 2013, he was appointed as the Senior Vice President and General Counsel of Rutgers University.
Farmer's book, The Ground Truth: The Untold Story of America Under Attack On 9/11, was released days before the eighth anniversary of the 9/11 attacks. In "The Ground Truth," Farmer made the following controversial statement: “At some level of government,” says Dean Farmer, “at some point in time, a decision was made not to tell the truth about the national response to the attacks on the morning of 9/11. We owe the truth to the families of the victims of 9/11. We owe it to the American public as well, because only by understanding what has gone wrong in the past can we assure our nation’s safety in the Future.”