In this article a technique to match the refractive index (n) of different diesel fuels with the refractive index of transparent materials is presented with the aim to improve the flow visualization inside transparent nozzles. For this purpose, a technique based on the variation of the angle of a laser beam passing through the tested fluid and the transparent material was used. The validation of this technique was performed by measuring the refractive index of known fluids (n-decane and n-hexadecane) and comparing them with literature ones. After this, the refractive index was determined for three different diesel fuels: commercial diesel, a rapeseed methyl ester biodiesel (RME) and cold start diesel. The uncertainty of the measurements represents a relative error respect to the mean of only 0.1%. Next, to equal the refractive index of each fuel with the refractive index of the transparent material (fused silica nozzle), a doping process was performed with 1-methylnaphthalene and n-hexadecane at different concentrations. The main advantage of applying this technique in visualization measurements is to obtain additionally the fuel refractive index and match this with the transparent nozzle under real conditions without requiring additional equipment such as refractometers.