Humidity induced changes in the refractive index and thickness of polyethylene glycol (PEG) thin films are in situ determined by optical waveguide spectroscopy. PEG brushes are covalently attached to the surface of a thin gold film on a borosilicate crown glass (BK7) using a grafting-from chemical synthesis technique. The measurements are carried out in an attenuated total internal reflection setup. At low humidity levels, both the refractive index and the thickness change gradually due to swelling of the PEG thin films upon water intake. At around 80% relative humidity, a steep decrease in the refractive index and a steep increase in the thickness are observed as a result of a phase change from a semicrystalline state to a physical gel state. The hydrogenation of PEG films causes a less pronounced phase change from a semicrystalline state to a gel state. Due to fewer ether oxygen atoms available for the water molecules to make hydrogen bonding, the polymer has a more stable structure than before and the phase change is observed to shift to higher humidity levels. It is discussed that such a humidity induced change in the index of refraction can be utilized in constructing of a PEG based humidity sensor.