Hopkinson was born to an elite family in Philadelphia and graduated from the College of Philadelphia in 1757; he became an attorney four years later. Hopkinson then spent two years studying under his mother's relative, the bishop of Worcester, in London, before returning to the colonies with a lucrative royal appointment as the collector of customs for Salem, New Jersey, in 1763. He added New Castle, Delaware, to his responsibilities in 1772. In 1774, Hopkinson's revolutionary sentiments caused him to resign his post and return to private legal practice in Bordentown, New Jersey. He was elected as one of New Jersey's delegates to the Continental Congress in 1776 and soon after signed his name to the Declaration of Independence.
As the American Revolution raged, Hopkinson returned to serve in the colony of his birth in 1777, first on the Navy Board at Philadelphia, then as treasurer of the Continental Loan Office in 1778 and finally with a seat on the Admiralty court in Pennsylvania in 1779. He joined Pennsylvania's ratification convention in 1787, and served on the bench of the United States District Court for the Eastern District of Pennsylvania from 1789 until his death.
In addition to his contributions to American history as a politician and jurist, Hopkinson is known as the father of American secular music, a talent complemented by his skills as a poet, playwright and harpsichordist. Some of his compositions reflected his patriotism, including The Battle of The Kegs, which described the Patriots' early attempt to mine the Delaware River using barrels filled with powder. Hopkinson also played a significant role in designing the first American flag.