We have calculated the optimal shape, i.e. the length-to-width ratio of a bacterial cell, that allows a bacterial cell to move most efficiently through liquid. For a cell of a given size, a minimum exists in the force required to move through any liquid when the length of the cell is approx. 3.7 times greater than the width. As this is in approximate agreement with the observed shape of bacteria such as the Enterobacteriaceae, we conjecture that the current observed shape of these bacteria may have been determined, in part, to obtain the most efficient shape for moving through liquids. It is also found that spherical cells are very inefficient in movement through liquid, while longer cells of a fixed size are still relatively efficient in moving through liquids. Since the optimal shape is independent of actual size (within large bounds), it is further proposed that hydrodynamic efficiency considerations support the proposal of constant shape over a range of sizes for rod-shaped bacteria.