How does a typical generator produce alternating current?

A commutator changes the induced current from direct to alternating current.
The magnetic field inside the generator turns off and on again between turns.
The magnetic field inside the generator changes direction once each turn.
After every half turn, the current in the armature’s wires reverses direction.

A typical generator produces alternating current by utilizing Faraday's Law of Electromagnetic Induction. As the rotor (rotating part) of the generator spins within a magnetic field, the changing magnetic field induces a current to flow in the wire coils of the stator (stationary part) of the generator. This current is alternating because the magnetic field changes direction (north to south pole) as the rotor spins, resulting in a current that reverses direction (flows back and forth) between the wire coils of the stator. There is no commutator in a typical generator, which is used in direct current (DC) generators, to convert direct to alternating current.