Allen was born into a prominent Philadelphia family. His father, William Allen, was a successful merchant and lawyer, and would later be the Chief Justice of the Supreme Court of Pennsylvania. Andrew graduated from the CityCollege of Philadelphia in 1759, read law under Benjamin Chew, and then went to London to complete a legal education at the Inner Temple. He returned to Philadelphia in 1765, was admitted to the bar, and began to practice law. That same year Allen was elected to the Pennsylvania Assembly. In 1766, he was appointed the colony's Attorney General. He married Sarah Coxe, sister of Tench Coxe, in April 1768. During the same year he was granted membership to the American Philosophical Society through his election. In 1770 his brother-in-law, Governor John Penn, gave him a seat on the Governor's Council. When tensions increased before the American Revolution, Allen was one of those critical of the Intolerable Acts passed by the British Parliament in 1774. He signed the non-importation agreement boycotting British goods in protest of the Boston Port Act, and helped form an independent militia unit, the First Troop Philadelphia City Cavalry, on November 2, 1774. On June 30, 1775, he was appointed to the Committee of Safety by the Assembly. In 1775 Allen was elected by the Pennsylvania Assembly as a delegate to the Second Continental Congress. The instructions given to Pennsylvania's delegates prohibited them from supporting any measures that would lead to independence from Great Britain. Allen hoped that Congress would seek reconciliation with the mother country, and was dismayed when Congress began moving towards independence in 1776. He resigned from the First City Troop in April of that year. On May 1, he was elected to the Pennsylvania Assembly in a special by-election. The election of moderates like Allen demonstrated that the voting public was still cautious about independence. Radicals in Pennsylvania, however, responded by holding a constitutional convention to create a new constitution and a new, less conservative, General Assembly. When the Continental Congress began considering a resolution of independence in June 1776, Allen withdrew from Congress, not attending any sessions after June 14. In December 1776, Allen finally switched sides. The situation in Philadelphia had become tense as a British army under General Howe drove George Washington's forces out of New York and towards Pennsylvania. In his diary, James Allen, brother of Andrew, described the precarious situation of those Philadelphians who were suspected of being unsympathetic to the Revolution, and how the Allen family reacted:
Houses were broken open, people imprisoned without any color of authority by private persons, and, as was said, a list of 200 disaffected persons made out, who were to be seized, imprisoned, and sent off to North Carolina; in which list, it was said, our whole family was put down. My brothers, under this dreadful apprehension, fled from Philadelphia to Union, where I went over to them. Soon after, against my judgment, they all went to Trenton, and claimed protection from General Howe's Army. From whence they went to New York, and there they now are, unhappily separated from their families, and like to be so for some time.
In 1777 Andrew Allen returned to Philadelphia with General Howe's army, but his stay lasted only as long as their occupation, and he returned with them to New York when the British evacuated the city in 1778. From there he made his way to England. Thereafter he practiced law in London. The Pennsylvania Assembly attainted Allen of treason in 1781 and confiscated his properties, along with those of others in his family. After the war, the British government reviewed his losses, and the "Commission for Claims and Losses" awarded him a lifetime pension of £400. In 1792, Allen was pardoned by Pennsylvania. He returned to Philadelphia in 1794 to attempt to recover some of the old payments due to him under the provisions of the Jay Treaty. This was unsuccessful, and he returned to London, where he spent the remainder of his life.