The invention aims to provide a double-shaft double-motor ship ammonia-electricity hybrid power system with a waste heat utilization function. The double-shaft double-motor ship ammonia-electricity hybrid power system comprises an ammonia fuel engine, a reversible motor, motors, a diesel generator set, a storage battery, a capacitor, a fuel cell, a propeller, a liquid ammonia storage and supply device, a power transformation device, a ship power grid, a ship load, a whole ship cooling system and a waste heat system. Hybrid propulsion of the ammonia fuel engine and the motor and coordinated power supply of the diesel generator set and the energy storage unit can be achieved. Meanwhile, multi-stage utilization of cold energy of the energy storage unit and the engine is achieved, a waste heatsystem can achieve multi-gradient utilization of heat energy, ship energy consumption is reduced, the whole ship efficiency is improved, and the application range of the system is widened.