The invention relates to an apparatus and a method for generating dialysate for dialysis, the apparatus comprising an electrolysis unit (14) for electrolysing waste dialysate, a hydrogen separation filter (18) for separating hydrogen from the electrolysed dialysate, and a hydrogen fuel cell (21) for generating pure water with the hydrogen obtained from the hydrogen separation filter and oxygen from the enviroment.