An analytical technique for computing the spectral linewidth of distributed-feedback (DFB) laser diodes is developed and applied to AlGaAs/GaAs devices. The results are presented graphically as a function of the coupling coefficient and compared to those for conventional Fabry-Perot laser diodes of the same cavity lengths (300, 1000, and 3000 microns). The linewidth of the DFB laser diodes is found to decrease rapidly as the length increases, with a further decrease if phase shifting is introduced. It is suggested that quantum efficiency in these devices can be maximized by improving the quality of the doping, interface, and gratings. Applications of DFB lasers to coherent optical communications systems and fiber-optic sensors are indicated.