The unoccupied electronic structure of the layered cuprates Sr2CuO2Cl2 and Ba2Cu3O4Cl2 has been studied using polarization-dependent x-ray absorption spectroscopy at the O 1s and Cu 2p(3/2) edges and band-structure calculations within the local-density approximation. In contrast to almost all high-temperature superconductors, there are no oxygen atoms outside the Cu-O planes in these oxychlorides. Our results represent therefore direct experimental information regarding the oxygen-derived unoccupied electronic structure of undoped Cu-O planes in square-planar coordination. The O 1s and Cu 2p(3/2) x-ray absorption spectra of Sr2CuO2Cl2 and Ba2Cu3O44Cl2 are quite similar with an essentially two-dimensional upper Hubbard band and extra oxygen and copper related absorption fine structure at higher energies. From its polarization dependence and a comparison to the results of the band-structure calculations, it is concluded that this extra fine structure is related to transitions into O 2p and Cu 3d3d(3z2-r2) orbitals which have become partly unoccupied due to hybridization with Sr 4d/Ba 5d/Cu 4p(z) and Cu 4s orbitals, respectively. Differences between these two compounds are the larger width of the upper Hubbard band and the higher relative Cu 3d(3z2-r2) hole occupation above the upper Hubbard band in Ba2Cu3O4Cl2. These differences can be related to the extra Cu-B atoms in the Cu3O4 planes of Ba2Cu3O4Cl2 with respect to the CuO2 planes of Sr2CuO2-Cl-2. [S0163-1829(98)03706-0].