Subject-matter jurisdiction is the authority of a court to hear cases of a particular type or cases relating to a specific subject matter. For instance, bankruptcy court only has the authority to hear bankruptcy cases.
Subject-matter jurisdiction must be distinguished from personal jurisdiction, which is the power of a court to render a judgment against a particular defendant, and territorial jurisdiction, which is the power of the court to render a judgment concerning events that have occurred within a well-defined territory. Unlike personal or territorial jurisdiction, lack of subject-matter jurisdiction cannot be waived. A judgment from a court that did not have subject-matter jurisdiction is forever a nullity.
To decide a case, a court must have a combination of subject (subjectam) and either personal (personam) or territorial (locum) jurisdiction.
Subject-matter jurisdiction, personal or territorial jurisdiction, and adequate notice are the three most fundamental constitutional requirements for a valid judgment.
 State courts
In the United States, many state court systems are divided into divisions such as criminal, civil law, family, and probate. A court within any one of those divisions would lack subject-matter jurisdiction to hear a case regarding matters assigned to another division. Most U.S. state court systems, however, include a superior court that has "general" jurisdiction; that is, it is competent to hear any case over which no other tribunal has exclusive jurisdiction. Because the United States federal courts have exclusive jurisdiction over a very small percentage of cases (e.g., copyright and patent disputes), state courts have the authority to hear the vast majority of cases.
 U.S. federal courts
Subject-matter jurisdiction is significantly more limited in United States federal courts. The maximal constitutional bounds of federal courts' subject-matter jurisdiction are defined by Article III Section 2 of the U.S. Constitution. Federal courts' actual subject-matter jurisdiction derives from Congressional enabling statutes, such as 28 U.S.C. §§ 1330-1369 and 28 U.S.C. §§ 1441-1452. The United States Congress has not extended federal courts' subject-matter jurisdiction to its constitutional limits. For example, the amount-in-controversy requirement for diversity jurisdiction is based on 28 U.S.C. § 1332, not a constitutional restriction. Moreover, Congress could constitutionally overrule the complete-diversity rule in diversity cases.
By far the most important two categories of federal subject-matter jurisdiction in non-criminal cases are federal question jurisdiction and diversity jurisdiction. The enabling statute for federal question jurisdiction, 28 U.S.C. § 1331, provides that the district courts have subject-matter jurisdiction in all civil actions arising under the Constitution, laws, or treaties of the United States. As mentioned before, this jurisdiction is ordinarily not exclusive; states too can hear claims based on federal law. The enabling statute for diversity jurisdiction, 28 U.S.C. § 1332, grants the district courts jurisdiction in an action that meets two basic conditions:
Complete diversity requirement. No defendant is a citizen of the same state as any plaintiff.
Amount in controversy requirement. The matter in controversy exceeds $75,000.
Federal courts also have removal jurisdiction, which is the authority to try cases removed by defendants from state courts. The contours of removal jurisdiction are almost identical to those of original jurisdiction. See removal jurisdiction for more information.
According to Rule 12(h)(3) of the Federal Rules of Civil Procedure, a federal court has the authority to dismiss a case for lack of subject-matter jurisdiction upon motion of a party or sua sponte, upon its own initiative.
In federal criminal cases (offenses against the laws of the United States), the federal district courts of the United States have subject matter jurisdiction granted under 18 U.S.C. § 3231.