Silicon oxynitride coatings on glass and polyethylene terephthalate (PET) film have been fabricated by thermal annealing of inorganic polymer perhydropolysilazane (PHPS) between 60 °C and 200 °C. The chemical structure, thermal behavior and structural evolution of PHPS were investigated. The coatings obtained on glass possess pencil hardness as high as 9H, high transparency above 90% in the visible wavelength range, good adhesion to the substrate and a hydrophobic property with water contact angle above 98°. The PHPS coated PET film has pencil hardness above 4H, water contact angle 102° and a high scratch resistance property with no obvious scratches after a 50 cycles scratch test under a load of 2 kg. All these data imply the great potential of PHPS as a hard coating for optical devices. © 2015 Society of Chemical Industry