A hofje is a Dutch word for a courtyard with almshouses around it. They have existed since the Middle Ages.
A hofje provided housing for elderly people (mostly women). They were privately funded, and served as a form of social security. In the Netherlands there are still a number of hofjes in use.
Hofjes are usually built in a U-shape with a yard or garden in the middle, and a gate as entrance. The shape of hofjes was most likely inspired by the (older) Begijnenhofjes -- groups of small houses inhabited exclusively by religious women.
A distinction is usually made between the Begijnenhofjes and 'regular' hofjes. The former were used only by (Catholic) women, who were supporting themselves. They were a sort of cloister. The latter were more charitable institutions.
To be eligible to live in a hofje one had to meet four criteria:
In the 18th century there were hofjes founded for commercial purposes; the inhabitants would pay rent.
The "Hofje van Mevrouw Van Aerden" in Leerdam is open to visitors as a museum.
Cities with many hofjes in the Netherlands include: