We determined the optimal length of the fiber amplifier theoretically by solving numerically set of differential equations of a single stage and one pass amplifier, using MATLAB. Input values, as doped density, core radius, pumping power and input signal were changed, and the optimal fiber length was calculated.