Profile of gear teeth #
Designing a pair of spur gears #

Pick the reduction ratio you want to between the two gears. Generally, you use gears to decrease speed and increase torque, or the reverse.

Choose the number of teeth on the small gear. 18 is a good number to start with, not least because it is an even divisor of 360. With the standard pressure angle of 20 degrees, you start to get undercutting with 17 teeth. The gear with the fewest teeth sold by McMaster has 12 teeth. The Lego gear with the fewest teeth has 8 teeth. The internet says that 7tooth gears exist, but I’ve never seen one in person.

Choose the diameter of the small gear, and see how big that makes your big gear.

Draw the pitch circles.

Draw the base circles 94% smaller than the pitch circles (because cos(20 degrees) is 0.94).

Draw a gear tooth profile that is like the path taken by the end of a string unwrapping from the base circle.
Stuff to add:
 How to make a lowbacklash gear using two stacked gears slightly misaligned
 Why helical gears exist (reducing torque ripple, basically, like riding a skateboard diagonally across cracks instead of both wheels hitting at the same time)