Ab initio calculations have been performed to unravel the origin of the recently found superlattice peaks in the trilayer nickelate La4Ni3O8. These peaks arise from static charge ordering of Ni2+/ Ni1+ stripes oriented at 45∘ to the Ni-O bonds. An insulating state originates from a combination of structural distortions and magnetic order, with the gap being formed solely within the dx2−y2 manifold of states. When doped, electrons or holes would go into these states, in a similar fashion to what occurs in the cuprates. Analogous calculations suggest that checkerboard charge order should occur in the bilayer nickelate La3Ni2O6. These results reveal a close connection between La4Ni3O8 and La3Ni2O6 with La2−xSrxNiO4 for x=1/3 and x=1/2, respectively.