Little is known of his early life; he was probably born in Hopkinton, Massachusetts. In 1777 he was commissioned as a captain in the 5th Massachusetts regiment and he participated in the battles of Bunker Hill, Ticonderoga, Saratoga and Stony Point. His service record was notable, and he was awarded a ceremonial sword by the Marquis de Lafayette at the end of the war for distinguished service. (Financial difficulties later led Shays to sell the sword.)
After retiring from the army in 1780 Shays settled in Pelham, Massachusetts, where he served in several local government positions. Economic conditions in the U.S., especially western Massachusetts, began a serious decline and by 1786 Shays became one of several who took command of units of rebels. The uprising soon became known as "Shays' Rebellion" after an encounter between a force of about 800 farmers under Shays, and a private militia unit of roughly the same size, at Springfield on September 26, 1786. Shays and his men were trying to prevent the state supreme court from convening, fearing indictments against farmers in arrears. No actual fighting took place during the incident, but tensions quickly escalated.
By the winter of 1786/7 there was open battle between government forces and rebels; after several skirmishes Shays and his men were defeated at Petersham, Massachusetts on February 2, 1787. Shays then fled to Vermont. Condemned to death in absentia on a charge of treason, Shays petitioned for amnesty in February 1788, and the petition was granted by John Hancock on June 13. Shays then relocated to New York.
Shays was later granted a pension by the federal government for his Revolutionary War service. He maintained for the rest of his life that his service in the Revolution and his fighting during the rebellion were for the exact same principles. He died in Sparta, New York and is buried in Springwater.