Hull Crown Court was told that Greencore Grocery had contracted the worker to carry out repairs at its factory in Hull in October 2013.
The company provided the electrician with a stepladder to stand on while wiring a motor situated above a machine, when he fell and sustained fatal injuries.
Greencore had failed to properly plan the job, said the Health and Safety Executive (HSE), including access arrangements for the installation of motors.
Greencore Grocery pleaded guilty to breaching s 3(1) of the Health and Safety at Work Act. It was fined £1m plus £30,000 costs.
HSE inspector Denise Fotheringham said after yesterday's hearing (5 September): "Work at height regulations require that all work at height is properly planned and appropriate access is provided. If Greencore had carried this out this death could have been prevented."