The U.S. Constitution was written in Independence Hall in Philadelphia in 1787 and ratified in 1788. It established the framework for the American federal government and guaranteed certain fundamental rights, with the first ten amendments known as the Bill of Rights added in 1791. Of the 55 delegates at the Constitutional Convention, 39 signed the document.