A coding metasurface is proposed for reducing radar cross section (RCS) under grazing incidence. Two elements with different reflection phases are selected for the metasurface, and 7 × 7 artificial magnetic conductor unit cells are utilised to construct a metamaterial block. Then the arrangement of blocks is optimised by particle swarm algorithm (PSA). The phase difference between two elements contributes to RCS reduction under grazing incidence. The obtained results demonstrate that a wideband RCS reduction is achieved by the coding metasurface ranging from 6 to 13 GHz. In addition, the monostatic RCS reduction is also achieved under a grazing incidence. For x-polarised incidence, the monostatic RCS reduction is >6 dB from 77° to 90°. For y-polarised incidence, the monostatic RCS reduction is >6 dB from 69° to 80°, and the maximum reduction is 17.5 dB under the 75° incident angle.