The Pennsylvania Writ of Habeas Corpus is a legal document that is used to challenge the legality of a person’s incarceration or detention. It is a court order that is issued by a court with jurisdiction over a particular case in order to ascertain the legality of a person’s confinement. The writ is typically used when a person believes there is no legal basis for their detainment or imprisonment, or when they believe their Constitutional rights have been violated. There are two types of Pennsylvania Writ of Habeas Corpus: an original Writ of Habeas Corpus and a Post-Conviction Writ of Habeas Corpus. An original Writ of Habeas Corpus is used when someone is challenging the legality of their confinement before a conviction has been entered. A Post-Conviction Writ of Habeas Corpus is used when someone is challenging the legality of their confinement after a conviction has already been entered. Both types of Writs are used to challenge the legality of a person’s confinement and to seek relief from that confinement.