In mechatronic applications such as electro-hydrostatic actuators, gerotor machines are often preferred over other technologies due to their high efficiency, low wear, low noise, and compactness. The design approach for hydraulic machines, either for motoring or pumping applications, involves the definition of different geometrical parameters, which affect their performance. Thus, the designer is often left without a clear design method to adopt. In this perspective, the presented research aims at providing a general design methodology of gerotor machines for their integration into high-efficiency mechatronic devices. In particular, the study focuses on the analytical and numerical characterization of the optimal tooth aspect ratio and maximum eccentricity between gears. Indeed, these two features are often left to the experience of the designer or are selected with empirical formulations. Our method is validated by means of numerical data from computational fluid-dynamic models to assess the performance of the hydraulic units.