A lien is any official claim or charge against property or funds for payment of a debt or an amount owed for services rendered. The “property” doesn’t necessarily have to be real estate, just something of value owned by the debtor.
A mortgage is a loan that has been secured by real estate. Typically a mortgage gives the lender the right to seize and sell your home if you default on the mortgage payments. A mortgage can become a lien if the mortgagor goes into default, but otherwise a mortgage is not technically a lien.
In county terminology, a Lien is a court-ordered claim against an individual recorded at the Prothonotary’s Office.
A Mortgage is a loan that has been secured by real estate recorded at the Recorder of Deeds office.