We demonstrate a tomographic method to measure arbitrary refractive index profiles of silica and polymer optical preforms. The preform is rotated through 180 degrees and the deflection angle data collected, then the back projection technique and spline interpolation algorithm are used in the computed tomographic two-dimensional profile distribution. An improved formula for calculating the optical path length from the deflection function is derived. To minimize the computing time, the spatial Nyquist frequency is used to estimate the angle sampling number of views and the numbers of points per scan in advance.