In the building sense the two are largely interchangeable, with custodian the more formal job title, especially in American schools. But custodian has a second, wider meaning that janitor does not: a guardian or keeper of something valuable — a custodian of records, of assets, of a tradition.
The core difference
They overlap in one sense and diverge completely in another.
- janitor — someone who cleans and maintains a building. One meaning only.
- custodian — the same role, more formally; and also a guardian or keeper: custodian of the archives, a custodian bank.
The second sense
This is where the words genuinely part. A custodian bank holds securities for clients. A custodian of records is responsible for their integrity. A museum may describe itself as custodian of a collection. Janitor cannot be used in any of those.
The origins are the same idea
Janitor comes from Latin ianua, door — via Janus, the two-faced god of doorways — so a janitor was originally a doorkeeper. Custodian comes from custos, guardian. Both began as words about guarding a threshold; only one kept the wider sense.