Two of the classic prerogative writs serve very different functions, even though both are often filed at the appellate level.
Mandamus and certiorari are frequently mentioned in the same breath because both trace back to the same family of English common-law prerogative writs, but they serve fundamentally different purposes.
Mandamus: compelling action
Mandamus commands a public official, agency, or lower court to perform a clear legal duty it has failed to perform. It is forward-looking — it makes something happen that has not yet happened.
Certiorari: reviewing a completed decision
Certiorari, by contrast, is a mechanism for reviewing a decision that a lower court or tribunal has already made, typically to determine whether that body acted within its lawful authority and followed proper procedure. It is backward-looking — it examines something that has already occurred.
Certiorari at the U.S. Supreme Court
The most familiar modern use of certiorari is the U.S. Supreme Court's discretionary review process: a "petition for a writ of certiorari" asks the Court to review a lower court's judgment, and the Court grants only a small fraction of the petitions it receives each year.
Overlapping use in some state systems
Some states, like New York, have folded the certiorari function into a broader unified proceeding (Article 78) rather than maintaining it as a separately named writ, which can create confusion for anyone comparing terminology across jurisdictions.
Choosing the right vehicle
If the problem is that an official has not yet acted, mandamus is the relevant tool. If the problem is that a tribunal already reached a decision and the petitioner believes that decision exceeded its authority or violated proper procedure, certiorari (or its modern statutory equivalent) is the more appropriate vehicle.