Same-sex marriage legislation in the United States

In response to court action in a number of states, the United States federal government and a number of state legislatures passed or attempted to pass legislation either prohibiting or allowing same-sex marriage or other types of same-sex unions.

On June 26, 2015, the Supreme Court of the United States ruled in the case of Obergefell v. Hodges that a fundamental right to marry is guaranteed to same-sex couples by the Fourteenth Amendment, and that states must allow same-sex marriage.

Federal level
In 1996, the United States Congress passed and President Bill Clinton signed Public Law 104–199, the Defense of Marriage Act (DOMA). Section 3 of DOMA defines "marriage" and "spouse" for purposes of both federal law and any ruling, regulation, or interpretation by an administrative bureau or agency of the United States government. The impact of Section 2 of DOMA, which relieves jurisdictions within the United States of any obligation to recognize same-sex relationships legally established in any other jurisdiction, is less clear.

In United States v. Windsor, the Supreme Court was asked to determine the constitutionality of Section 3 of DOMA, which defines marriage for federal purposes as the union of a man and a woman. On June 26, 2013, the Supreme Court ruled by a 5–4 vote that the Section 3 of DOMA is unconstitutional.

The State Marriage Defense Act, introduced in the House of Representatives on January 9, 2014, would require the federal government to recognize the validity of a marriage based on a person's legal residence (place of domicile), rather than on the validity of the marriage when and where it was solemnized (place of celebration). The Obama administration has generally used the latter standard. Its sponsors described it as a way to clarify the federal government's response to Windsor and restore the ability of the a state to control the definition of marriage within its borders.

In Obergefell v. Hodges, the Supreme Court was asked to determine the constitutionality of state bans on same-sex marriage licenses as well as state bans on recognition of same-sex marriages from other states. On June 26, 2015, the court ruled by a 5–4 vote that the Fourteenth Amendment obliges states to license same-sex marriages and to recognize same-sex marriages from other states.

In the, and Congresses, the Respect for Marriage Act (RFMA) was introduced by House and Senate Democrats to repeal DOMA. These efforts eventually prevailed in 2022, with the bill passing the House 267–157 and the Senate 61–36. President Joe Biden signed the bill into law on December 13, 2022.

Efforts to enable same-sex unions
Votes by state legislatures to recognize various types of same-sex unions, sorted by date:

Notes:
 * Veto overridden
 * People's veto (Maine Question 1, 2009)
 * People's veto failed (Washington Referendum 71, Washington Referendum 74, Maryland Question 6)
 * The bill was allowed to lapse into law.

Efforts to prohibit same-sex unions
Votes by state legislatures to prohibit recognition of various types of same-sex unions, sorted by date: Notes:
 * On June 26, 2015, the Supreme Court of the United States ruled in the case of Obergefell v. Hodges that a fundamental right to marry is guaranteed to same-sex couples by the Fourteenth Amendment, and that states must allow same-sex marriage.
 * Subsequently, repealed.
 * The bill was allowed to lapse into law.
 * Veto overridden.

Efforts to ban same-sex unions by constitutional amendment
The following table shows all popular vote results regarding state constitutional amendments concerning same-sex marriage, and in some cases civil unions and domestic partnerships. The Hawaii amendment is different in that it granted the legislature authority to "reserve marriage to opposite-sex couples" (which the legislature had already done).

Efforts to ban same-sex unions by statute
The following consists of votes by statutory initiatives that ban same-sex marriage and/or civil unions and domestic partnerships:

Notes:
 * There is a debate as to whether the adoption of Prop 22 only prohibited California from recognizing same-sex marriages performed in other states.
 * In March 2005, Judge Richard Kramer ruled there appeared to be no rational state compelling interest in limiting marriage to heterosexual couples. His ruling was appealed to the California Court of Appeal for the 1st District, which upheld Proposition 22 on October 5, 2006. The Supreme Court of California ruled on May 15, 2008, that Proposition 22 is unconstitutional and it was struck down by the state's highest court.
 * Subsequently, repealed by state legislature.

Lawsuits seeking to overturn statutory bans
The following lists cases seeking to overturn marriage bans: