This study investigates the effect of the fences with varying height and chord length on the secondary flow reduction. Three-dimensional flow structure on the endwall and streamline on the blade surface are analyzed to determine the effect of fence geometry on the secondary flow reduction. The results demonstrate that the pressure leg of the horseshoe vortex induced by the fences can prevent the passage vortex of the main blade. In this work, a fence geometry is found to reduce the secondary flow loss and decrease the total pressure loss coefficient of the main blade by about 4%. However, the fences with large chord length are found to bring a greater additional flow loss, which is induced by the flow separation of the fences. Thus, the fences could be applied only when the fences induced additional loss is lower than the loss due to the secondary flow that they prevent.