A duo is the pair of performers. A duet is the piece of music written for two performers. A duo performs a duet — the words name different things, though they are often swapped. In practice, duet is also used loosely for the performance itself.
The core difference
People versus composition. The confusion is understandable because the two arrive together.
- duo — two performers considered as a unit: a comedy duo, a piano duo.
- duet — a work for two performers: a duet for violin and piano.
The rest of the set
Solo (one), trio (three), quartet (four), quintet (five). Notice that these double as both the group and the work — a string quartet is four players and also a piece written for them. Duo and duet are unusual in having kept separate words for the two ideas.
Outside music
Duo travels well beyond music — a comedy duo, a criminal duo. Duet stays largely musical, though it stretches to a figurative "duet" of two voices in dialogue.