A work machine includes a machine body, an engine, a rotary electrical device, and a battery. The engine is provided on the machine body to move the machine body. The rotary electrical device is provided on the machine body to move the machine body and to generate electric power. The battery is to be charged by the rotary electrical device and to discharge electric power to the rotary electrical device to move the machine body. The battery being is provided adjacent to the engine.