The refractive-index profile (RIP) of optical fibers is of fundamental significance in determining critical fiber properties. Here, we present the application of a two-dimensional (2-D) scanning focused refractive-index microscopy (SFRIM) to accurately obtain the 2-D RIP of a graded-index optical fiber. Some modifications are made to SFRIM for better 2-D measurement. Quantitative RIP of the fiber is obtained with derivative total reflection method. The refractive-index accuracy is 0.002. The measured result is in good agreement with theoretical expectation. This method is straightforward, simple, repeatable, and free from signal distortion. This technique is suitable for symmetric and asymmetric optical fibers. The results indicate that this technique can be applied to obtain the RIPs of a wide range of materials and has broad application prospect in many fields.