In the case of a will, the testator inherits.
In the absence of a will, the Civil Code Act indicates who inherits and in what shares. When there are no legal heirs, the municipality or the State inherits.
In accordance with the provisions of Article 934 § 1 and 2 of the Civil Code, in the absence of descendants, spouse, parents, siblings and descendants of the testator's siblings, the entire inheritance falls to the testator's grandparents; they inherit in equal shares; if one of the testator's grandparents has not lived to see the opening of the inheritance, the share of the inheritance that would fall to him/her falls to his/her descendants. That share shall be shared in accordance with the rules governing the sharing-out of the estate among the testator's descendants. In the absence of descendants of the grandfather who has not lived to see the opening of the succession, the share of the succession which would have fallen to him falls to the remaining grandparents in equal shares.
In accordance with the provisions of Article 9341 of the Civil Code, in the absence of the testator's spouse and relatives called to the inheritance by law, the inheritance falls in equal parts to the children of the testator's spouse, who neither of their parents lived to see the opening of the inheritance.
In accordance with Art. 935 of the Civil Code, in the absence of the testator's spouse, his/her relatives and the children of the testator's spouse called to the inheritance by law, the inheritance falls to the municipality of the testator's last place of residence as a legal heir. If the testator's last place of residence in the Republic of Poland cannot be established, or the testator's last place of residence was abroad, the inheritance is inherited by the State Treasury as a legal heir.