In this communication, we show how a short-pitch diffractive structure can be used as a low-cost high sensitivity device for refractive index measurements with sensitivity of 10(-2). The device consists of a photo-resist diffraction grating put in optical contact with a hollow prism used as a container for a test material. Its main advantage is the possibility to monitor the composition of solids, fluids and gases in real time. Knowledge of optical parameters of a system with high accuracy can be vital when working in the biological/medical field.