
551 F.3d 572 (2008)
In re: LIMITNONE, LLC, Petitioner.
No. 08-3499.
United States Court of Appeals, Seventh Circuit.
Submitted October 2, 2008.
Decided December 19, 2008.
*573 David A, Rammelt (submitted), Kelley Drye & Warren LLP, Chicago, IL, for Petitioner.
Michael T. Zeller (submitted), Quinn Emanuel Urquhart Oliver & Hedges, LLP, Los Angeles, CA and Jon Cyrluk, Stetler & Duffy, Chicago, IL, for Respondent.
Before BAUER, COFFEY, and SYKES, Circuit Judges.
PER CURIAM.
In this intellectual-property dispute, the district court ordered the case transferred to the Northern District of California on the basis of forum-selection clauses in two of the contracts between the parties. LimitNone, LLC, filed a petition for a writ of mandamus seeking an order directing the district court to vacate the transfer order. Because LimitNone has not shown an indisputable right to the relief it seeks, we deny the petition for a writ of mandamus.

I. Background
LimitNone is a software development and consulting company. Google, Inc., the real party in interest, also in the computer-software business, developed a suite of applications called "GoogleApps" to compete with the Microsoft Office suite of products. As of January 2007, Google lacked a method for Microsoft Outlook *574 users to move their e-mail, calendar, and contacts to the Google platform. LimitNone developed an application called "gMove" to fill this need. According to LimitNone, Google encourages and solicits third-party developers to develop applications for use with Google's existing products. Accordingly, LimitNone pitched its gMove product to Google in March 2007. Before the meeting LimitNone signed a "Mutual Non-Disclosure Agreement," and both parties signed a "Google Enterprise Professional Agreement." Both agreements provided that the parties agreed to protect the confidentiality of the information that they exchanged. The agreements also contained forum-selection clauses providing that the "exclusive venue for any dispute relating to this Agreement shall be in state or federal courts within Santa Clara County, California." Finally, both agreements provided that any modifications must be made in writing and signed by the parties.
The parties exchanged trade secrets during the meeting, and afterward LimitNone revised gMove to meet Google's additional specifications. LimitNone then provided a "beta" version of gMove to Google. LimitNone asserts that when a Google employee installed the beta version of the gMove software, he electronically agreed to the "Beta License Agreement" on behalf of Google by clicking "accept" on a preliminary screen before proceeding with the program. In September 2007 LimitNone sent Google a final version of gMove. LimitNone maintains that a Google employee clicked "accept" on the "LimitNone License Agreement." This electronic agreement, unlike those signed before the meeting, provided for exclusive jurisdiction and venue in the state courts sitting in Lake County, Illinois, or the United States District Court for the Northern District of Illinois.
The parties continued to refine gMove over the next several months. Then, in December 2007 Google notified LimitNone that it had developed its own alternative to gMove called "Google Email Uploader," which it would give to its customers for free, thus destroying LimitNone's customer base for its gMove product.
In June 2008 LimitNone sued Google in the Circuit Court of Cook County, Illinois, alleging violations of the Illinois Trade Secrets Act, 765 Ill. Comp. Stat. 1065/1 et seq., and the Illinois Consumer Fraud and Deceptive Business Practices Act, 815 Ill. Comp. Stat. 505/1 et seq. The next month Google removed the case to the United States District Court for the Northern District of Illinois. See 28 U.S.C. § 1441. Google asserted that removal was proper because the Consumer Fraud Act claim was preempted by the federal Copyright Act, see 17 U.S.C. § 301, and the federal court had supplemental jurisdiction over the Trade Secrets Act claim. LimitNone sought leave of the court, as Judge Manning requires, to file a motion to remand, and Google filed a motion to dismiss or, in the alternative, to transfer the case under 28 U.S.C. § 1404(a) to the Northern District of California. Google asserted that the business relationship between the parties was governed by the Non-Disclosure Agreement and the Google Enterprise Professional Agreement, both of which vested exclusive jurisdiction in the federal and state courts sitting in Santa Clara County, California.
The district court found that the Non-Disclosure Agreement and the Google Enterprise Professional Agreement applied to this dispute and that the other agreements could not have superseded them because according to LimitNone's own description, they were not in writing or signed by the parties. The district court therefore ordered the case transferred to the Northern *575 District of California but did so under 28 U.S.C. § 1406(a), holding that venue in Illinois was improper given the forum-selection clauses. The court never ruled on LimitNone's request for leave to file a motion to remand. LimitNone now petitions for a writ of mandamus directing the district court to vacate its order transferring the case. The district court stayed the transfer pending the resolution of this petition.

II. Analysis
Mandamus is an extraordinary remedy. This court will issue the writ only when two conditions are met:
The first is that the challenged order not be effectively reviewable at the end of the casein other words, that it inflict irreparable harm. . . . The petitioner must ordinarily demonstrate that something about the order, or its circumstances, would make an end-of-case appeal ineffectual or leave legitimate interests unduly at risk. . . . Second, the order must so far exceed the proper bounds of judicial discretion as to be legitimately considered usurpative in character, or in violation of a clear and indisputable legal right, or, at the very least, patently erroneous.
United States v. Vinyard, 539 F.3d 589, 591 (7th Cir.2008) (quoting In re Rhone-Poulenc Rorer, Inc., 51 F.3d 1293, 1295 (7th Cir.1995) (omissions in original)).
This court has approved of the use of mandamus to prevent out-of-circuit transfers under 28 U.S.C. § 1404. See Hicks v. Duckworth, 856 F.2d 934, 935 (7th Cir. 1988) ("It is difficult to see how such an error could be corrected otherwise."). The Supreme Court, however, has suggested that mandamus is not an appropriate remedy for an erroneous transfer order under § 1406(a). Bankers Life & Cas. Co. v. Holland, 346 U.S. 379, 380-81, 383-85, 74 S.Ct. 145, 98 L.Ed. 106 (1953).
Bankers Life might control this case except that the district court mischaracterized the transfer as one under § 1406(a) when it was 28 U.S.C. § 1404(a) that provided the necessary authority. Transfer under § 1406(a) is appropriate only when venue is improperly laid. 28 U.S.C. § 1406(a). Venue is proper in a federal-question (or, as here, purported federal-question) case in the judicial district where the defendant resides. Id. § 1391(b). A corporation is deemed to reside in any district "in which it is subject to personal jurisdiction at the time the action is commenced." Id. § 1391(c). Google is licensed to do business in the State of Illinois and does business in the Northern District of Illinois. We have no doubt that the federal court sitting in that district had personal jurisdiction over Google when LimitNone filed its complaint. See Int'l Shoe Co. v. Washington, 326 U.S. 310, 319, 66 S.Ct. 154, 90 L.Ed. 95 (1945); Kinslow v. Pullara, 538 F.3d 687, 690-91 (7th Cir.2008). Venue was therefore proper, within the meaning of § 1391,[1] in the Northern District of Illinois, notwithstanding the forum-selection clauses. There often may be multiple proper venues, although one, on the basis of a forum-selection clause or for other reasons, may be superior to the rest. See Albion v. YMCA Camp Letts, 171 F.3d 1, 2 n. 1 (1st Cir.1999). Because the Northern District of Illinois was not an improper *576 venue, § 1404(a), rather than § 1406(a), provided the authority for the transfer order.[2]See also Stewart Org., Inc. v. Ricoh Corp., 487 U.S. 22, 29, 32, 108 S.Ct. 2239, 101 L.Ed.2d 22 (1988) (applying § 1404(a) to transfer based on forum-selection clause). Mandamus is therefore an appropriate means to challenge the transfer order. See Hicks, 856 F.2d at 935.
LimitNone, however, has not shown the district court's order exceeded its jurisdiction or was otherwise erroneous. LimitNone maintains that the district court exceeded its authority in ordering the case transferred because (1) the district court failed to consider the "convenience, fairness, and judicial economy" of transferring the case before ruling on subject-matter jurisdiction, purportedly contrary to Sinochem International Co. v. Malaysia International Shipping Corp., 549 U.S. 422, 127 S.Ct. 1184, 1192, 167 L.Ed.2d 15 (2007);[3] and (2) the district court ruled on matters going to the merits of the dispute without first establishing its own subject-matter jurisdiction. LimitNone relies, if indirectly, on the Supreme Court's repudiation of the doctrine of "hypothetical jurisdiction" in Steel Co. v. Citizens for a Better Environment, 523 U.S. 83, 118 S.Ct. 1003, 140 L.Ed.2d 210 (1998).
The district court transferred the case before ruling on LimitNone's motion to remand because, it concluded, "the issue of venue is fairly easy to resolve." The district court further noted that the conduct at issue occurred "mostly" in California. The relative ease of determining venue before subject-matter jurisdiction is an issue of judicial economy; the site of the majority of the conduct in question concerns the convenience and fairness of transferring the case. Assuming for the sake of argument that Sinochem imposes on district courts the requirements regarding transfer orders that LimitNone suggests, the district court satisfied them here.
Furthermore, the district court was not required to determine its own subject-matter jurisdiction before ordering the case transferred. Although in Steel Co. the Supreme Court mandated that issues of jurisdiction precede a determination of the merits, the Supreme Court has consistently held that "there is no mandatory `sequencing of jurisdictional issues.'" Sinochem, 127 S.Ct. at 1191 (quoting Ruhrgas AG v. Marathon Oil Co., 526 U.S. 574, 584, 119 S.Ct. 1563, 143 L.Ed.2d 760 (1999)). Indeed, "a federal court has leeway `to choose among threshold grounds for denying audience to a case on the merits.'" Id. (quoting Ruhrgas, 526 U.S. at 585, 119 S.Ct. 1563). For example, the Supreme Court has approved of addressing personal jurisdiction before subject-matter jurisdiction, see Ruhrgas, 526 U.S. at 584-85, 119 S.Ct. 1563, and of addressing venue before personal jurisdiction, see Leroy v. Great W. United Corp., 443 U.S. 173, 180, 99 S.Ct. 2710, 61 L.Ed.2d 464 (1979). Other ways a district court may *577 dispose of a case before reaching the meritsand thus without necessarily first determining its own subject-matter jurisdictioninclude declining to adjudicate state-law claims, see Moor v. County of Alameda, 411 U.S. 693, 715-16, 93 S.Ct. 1785, 36 L.Ed.2d 596 (1973); abstaining under the doctrine of Younger v. Harris, 401 U.S. 37, 91 S.Ct. 746, 27 L.Ed.2d 669 (1971), see Ellis v. Dyson, 421 U.S. 426, 433-34, 95 S.Ct. 1691, 44 L.Ed.2d 274 (1975); and dismissing lawsuits under the doctrine of Totten v. United States, 92 U.S. 105, 23 L.Ed. 605 (1875) (prohibiting suits against the government based upon covert espionage agreements), see Tenet v. Doe, 544 U.S. 1, 7 n. 4, 125 S.Ct. 1230, 161 L.Ed.2d 82 (2005). We see no reason to treat venue differently.
The line that the Supreme Court has drawn, consistent with its holding in Steel Co., is that jurisdiction "`is vital only if the court proposes to issue a judgment on the merits.'" Sinochem, 127 S.Ct. at 1191-92 (quoting Intec USA, LLC v. Engle, 467 F.3d 1038, 1041 (7th Cir.2006)). The question, then, is whether the district court's transfer order constituted a judgment on the merits. It did not. No judgment on the merits has been entered in this case. LimitNone implicitly recognizes as much; for if a final judgment had been entered, this petition would be unnecessary. See 28 U.S.C. § 1291. A determination "that venue is improper . . . is not a determination of the claim, but rather a refusal to hear it." Bryant v. Rich, 530 F.3d 1368, 1374 (11th Cir.2008) (quoting 18 JAMES WM. MOORE ET AL., MOORE'S FEDERAL PRACTICE, § 131.30[3][b] at 104 (3d ed.2008)). The Supreme Court's decision in Sinochem is particularly instructive. There, the Court held that a dismissal on the grounds of forum non conveniens was "a determination that the merits should be adjudicated elsewhere." Sinochem, 127 S.Ct. at 1192. It "does not entail any assumption by the court of substantive `law-declaring power.'" Id. at 1192-93 (quoting Ruhrgas, 526 U.S. at 584-85, 119 S.Ct. 1563). And as § 1404(a) is nothing more than a codification of the traditional forum non conveniens rules without the attendant disadvantages of outright dismissal, see Sinochem, 127 S.Ct. at 1190-91; Lafferty v. St. Riel, 495 F.3d 72, 79 n. 8 (3d Cir.2007); Albion, 171 F.3d at 2, it is appropriate to apply the same rules regarding the necessity of establishing jurisdiction to both.
LimitNone maintains that the factual determinations necessary to the transfer decisionthat is, which contracts govern this dispute and where the parties have agreed to litigateconstituted decisions on the merits, and as a result, they were improperly made before a decision on subject-matter jurisdiction was rendered. District courts are permitted, indeed, in some instances required, to make whatever factual findings are necessary prior to issuing a preliminary order. See, e.g., Szabo v. Bridgeport Machines, Inc., 249 F.3d 672, 676 (7th Cir.2001) (instructing district courts to make whatever factual findings are necessary to a determination of class certification). Such is the case for determining where venue properly lies. Id. The Supreme Court rejected arguments to the contrary in Ruhrgas and Sinochem. In Sinochem, the Court reasoned:
Of course a court may need to identify the claims presented and the evidence relevant to adjudicating those issues to intelligently rule on a forum non conveniens motion. But other threshold issues may similarly involve a brush with "factual and legal issues of the underlying dispute." For example, in ruling on the nonmerits threshold question of personal jurisdiction, a court may be called upon to determine whether a defendant's *578 contacts with the forum relate to the claim advanced by the plaintiff.
Sinochem, 127 S.Ct. at 1192 (quoting Van Cauwenberghe v. Biard, 486 U.S. 517, 529, 108 S.Ct. 1945, 100 L.Ed.2d 517 (1988)) (citation omitted); see also Ruhrgas, 526 U.S. at 585-86, 119 S.Ct. 1563. Other examples are not hard to imagine. A factual dispute regarding diversity of citizenship might overlap with the merits of an action. Or, as the Supreme Court noted in Ruhrgas, a federal court could conclude that state law does not allow punitive damages and remand the removed case for failure to meet the amount-in-controversy requirement. The plaintiff may be precluded from relitigating that point in state court even if it overlaps with the merits of the action. See Ruhrgas, 526 U.S. at 585-86, 119 S.Ct. 1563. But the fact that issues necessary to a determination of some preliminary inquiry may overlap, or as LimitNone has put it, "arguably impact[ ]" the merits of the case, does not mean that the preliminary inquiry is a decision on the merits that requires the court to first determine its own jurisdiction. It would be awkward, at best, to suggest that district courts must resolve their own jurisdiction before proceeding to factual disputes necessary to that very determination. Although LimitNone may be barred from relitigating the issue of venue, the district court did not exceed its authority by making that decision prior to determining its subject-matter jurisdiction.
Our holding today should not be read to suggest that district courts may in every case decide venue in advance of subject-matter jurisdiction without due consideration of whether it is advisable to do so. There may be circumstances in which a court abuses its discretion in electing to resolve one jurisdictional issue before another. See Leroy, 443 U.S. at 180, 99 S.Ct. 2710 (noting that reversing the usual order of personal jurisdiction and venue requires "sound prudential justification"). Indeed, the transfer statute itself provides that the "interest of justice" is a necessary precondition to transferring a case to another district. 28 U.S.C. § 1404(a). But LimitNone has suggested only that the district court erred as a matter of law, and the indeterminacy of subject-matter jurisdiction is not, standing alone, a bar to consideration of venue.
Because the district court did not act outside of its authority either in the manner of its consideration of the transfer request or in deciding the issue of venue prior to subject-matter jurisdiction, the petition for a writ of mandamus is denied. LimitNone may move to remand the case to state court, should it so desire, after the case is transferred. See 28 U.S.C. § 1447(c) ("If at any time before final judgment it appears that the district court lacks subject matter jurisdiction, the case shall be remanded.").
PETITION DENIED.
NOTES
[1]  We take no position on whether LimitNone's claims "aris[e] under" the Copyright Act, but note that we would reach the same conclusion if we applied the venue provision applicable to copyright actions. See 28 U.S.C. § 1400(a); Janmark, Inc. v. Reidy, 132 F.3d 1200, 1203 (7th Cir. 1997) (applying the definition of "reside" found in § 1391(c) to venue determination under § 1400(a)).
[2]  The district court appears to have subsequently corrected itself. In its order granting a stay of proceedings pending the resolution of this petition, the court referred to the transfer order as "discretionary," and 28 U.S.C. § 1404(a) uses the permissive language "a district court may transfer," while § 1406(a) uses the mandatory language "shall dismiss, or . . . transfer." See 28 U.S.C. §§ 1404(a) & 1406(a).
[3]  Google submits that LimitNone waived this argument by failing to raise it in the district court, but Google has not directed us to any case where the principles of waiver or forfeiture have been applied to an original action commenced in the court of appeals. We therefore proceed to the merits.
