Power quality is one of major concerns in the present era. It has become important, especially, with the introduction of sophisticated devices, whose performance is very sensitive to the quality of power supply. Power quality problem is an occurrence manifested as a nonstandard voltage, current or frequency that results in a failure or mis-operation of end user equipments. One of the major problems dealt here is the voltage sag. To solve this problem, custom power devices such as Distribution Static Compensator (D-STATCOM), Dynamic Voltage Restorer (DVR), and Unified Power Quality Conditioner (UPQC) are used. In this paper, DVR, which is the most efficient and effective modern custom power device used in power distribution networks, is employed because of its lower cost, smaller size, and fast dynamic response to the disturbance. This paper presents the simulation analysis of a DVR in MATLAB / SIMULINK environment and its hardware implementation for voltage sag compensation. The results showed clearly the performance of the DVR in mitigating voltage sags