High magnetic field technology has played an important role in basic scientific researches. High-stability flat-top pulsed magnetic field can meet the demands of high field intensity and high stability in modern scientific experiments. The higher stability of flat-top magnetic field would be the more benefit to the observation of experimental phenomena (such as specific heat measurement and NMR experiment). In order to reduce the ripple of flat-top magnetic field, an active ripple compensator is presented in this paper for the 50 T dual-coil magnet system at the Wuhan National High Magnetic Field Center. The compensator is composed of a compensation coil and its power supply. The compensation coil, which is put inside the 50 T dual-coil magnet coaxially, is used to generate a magnetic field to compensate the ripple generated by the 50 T dual-coil magnet. The energy to operate the coil is provided by a 16 V/500 F super capacitor. To accommodate the needs of this coil, a PWM full-bridge circuit with variable output and bidirectional energy flow, is designed as the discharge circuit. The active ripple compensator has the advantages of modularization, flexibility and low energy consumption. The simulation model including the generator-rectifier power supply is established on the MATLAB/SIMULINK platform. The ripple of 50 T magnetic field is reduced from 1000 ppm to 100 ppm, which verifies the feasibility of the scheme. Acknowledgements: The National key research and development program of China (2016YFA0401702) and the Program for New Century Excellent Talents in University.