What are you building, and what CAD software do you prefer to use? I can recommend the exact gear generator tool or plugin that fits best into your current workflow. Share public link
There are several ways to generate an STL, depending on your preferred workflow: 1. Web-Based Tools (No Install Required) gear+generator+stl
Features a native "Spur Gear" script under the Utilities menu. It generates a 3D component that you can modify and right-click to "Save as Mesh/STL." What are you building, and what CAD software
3D printers plastic tends to expand slightly. If your motor shaft is exactly 5mm, configure the gear's bore diameter to 5.2mm to ensure a proper fit. What are you building