Basic Definition: The circle of fifths is a visual representation of the relationships among the 12 tones of the chromatic scale(1), their corresponding keys signatures(2), and the associated major and minor keys. Below, you see the geometrical representation of relationships among the 12 pitch classes of the chromatic scale in pitch class space(3).
Digging Deeper
Going around the circle, each pitch is 7 semitones(half steps) higher than the last. At the top you see C Major and it has no sharps or flats at the bottom 6 flats/6 sharps.
Clockwise - As you move clockwise by ascending fifths you gain 1 sharp until you reach the bottom for 6 sharps at F Sharp/G Flat.
Counterclockwise - In the opposite direction you are descending fifths and instead of sharps they're flats. To pass twelve tones in this direction you have to ascend by perfect fourths(5 semitones) rather than fifths(7 semitones). You will find this comparison more often in Jazz music while the ascending fifths is often used to analyze classical music.
Enharmonic key signature(equivalent notes) - At the bottom of the circle, the sharp and flat keys overlap giving you pairs of enharmonic key signatures.
The circle and diatonic key signatures:
The circle can be used to represent the relationship between diatonic scales(4) where each letter represents the major scale with that note as tonic. In example, the major scale of D has 2 sharps. Minor scales as noted in the example above are rotated 3 letters counterclockwise to calculate sharps/flats. For any major key, a scale can be built beginning on the sixth degree(relative minor key) containing the same notes.
Example: G-Major scale(G-A-B-C-E-F#-G) is enharmonic to the e-minor scale(E-F#-G-A-B-C-D-E)
When playing remember that the major key you are in is one half-step above the last sharp you see in the key signature. Since diatonic scales contain seven pitch classes they share six of their seven notes so it's easy to move between scales(modulation). C Major -> G Major = F-C-G-D-A-E-B -> C-G-D-A-E-B-F#
Instrumental Examples: Start at any key on the piano and count seven keys to the right. Those 7 keys are equal to 7 semitones or half steps and also equal to 5 steps within a major or minor scale.
Tones in all keys:
(1) Chromatic Scale
(2) Key Signature: A set of sharp or flat symbols placed together on the staff. They designate the notes that are to be played high or lower than the corresponding natural notes and applies through to the end of the piece or up to the next key signature.
(3) Pitch class space: is the circular space representing all the notes or pitch classes in a musical octave. The different pitches are represented by a single letter in class space(ex: C = C4,C5,C6).
(4) Diatonic Scales: the diatonic scale is composed of seven pitches and a repeated octave. It includes five whole steps and two half steps for each octave. The two half steps are separated from each other by either two or three whole steps, depending on their position in the scale. The 7 pitches of any diatonic scale can be obtained by using a chain of six perfect fifths. C-major example: F-C-G-D-A-E-B