Varnum was born in Dracut, Massachusetts, on December 17, 1748. He attended Harvard and then Rhode Island College (now Brown University). An honors student, he graduated in 1769 after successfully debating the thesis that America should remain a colonial dependent of England. He taught school for a brief period, studied law with Rhode Island's attorney general, and then opened his own legal office in East Greenwich. In 1774, he helped to organize Rhode Island's Kentish Guards, of which he was commissioned colonel.
After the British marched on Lexington and Concord, Varnum joined the Rhode Island militia. He served during the siege of Boston and the Battle of Long Island. He later commanded Continental Army troops at Forts Mercer and Mifflin, for which he received a commendation. After the winter at Valley Forge, and the Monmouth and the Newport campaigns, he became commander of the Department of Rhode Island. He remained in this position to revive his law practice. He was a founding member of the Society of the Cincinnati and its Rhode Island chapter's first vice president.
At the end of the war, Varnum represented Rhode Island in Congress from 1780 to 1782 and again in 1787, when he supported the new federal Constitution. That year, his work as a director of the Ohio Company of Associates earned him an appointment as a federal judge for the Northwest Territory. There, he helped to write the territory's legal code. Varnum died in Marietta, Ohio, on January 10, 1789.