Born in Boston, Massachusetts, to the Rev. Samuel Dexter, the 4th minister of Dedham, he graduated from Harvard University in 1781 and then studied law at Worcester under Levi Lincoln, Sr., the future Attorney General of the United States. After he passed the bar in 1784, he began practicing in Lunenburg, Massachusetts.
He was elected to the Massachusetts House of Representatives and served 1788 to 1790. He was elected to the 3rd Congress by way of the United States House of Representatives and then elected as Federalist to the United States Senate. In December 1799, he memorably wrote the memorial eulogy to George Washington upon the first president's death. His house in Dedham stands to today.
He served for less than a year as he was appointed United States Secretary of War by President John Adams in 1800. During his time at this station he urged congressional action to permit appointment and compensation of field officers for general staff duty.
Upon Secretary of the Treasury Oliver Wolcott, Jr.'s resignation in December 1800, Adams appointed Dexter as interim Secretary. He then briefly conducted the affairs of the foreign Office and administered the oath of office to Chief Justice John Marshall and declined the ambassadorship to Spain.
He returned to Boston in 1805 and resumed practicing law. He left the Federalist party to espouse Republican views on the War of 1812, and he was an unsuccessful candidate for Governor of Massachusetts in 1814 and 1815. He was an ardent supporter of the temperance movement and presided over its first formal organization in Massachusetts.