In music theory, a diminished fifth is an interval that has six half steps
The diminished fifth requires that:
- The interval must be a fifth interval (five note names between the first and the last).
- The interval must have six half steps.
What does a diminished fifth look like?
Here is an example of a melodic diminished fifth (two music notes in a melody) and a harmonic diminished fifth (in a chord):

How to recognize a diminished fifth?
Rule of music theory: All intervals in a major scale starting with the tonic (degree I) are either major or perfect, and only unison, octave, fourth and fifth are perfect (the others are major).
Example with the interval C / G♭:
Let's take the C major scale to have as the tonic:

From the rule stated above, the interval C / G is a perfect fifth, so the interval C / G♭ is a diminished fifth.
Inversion of the diminished fifth
The inversion of the diminished fifth is the augmented fourth.
Here is an example of an augmented fourth:

Musical examples of diminished fifth
Danse Macabre (Dance of Death) by Camille Saint-Saëns
Camille Saint-Saëns uses successive diminished fifths in his Danse Macabre (Dance of Death):

Interval identification game
You will find this interval in my Intervals identification game: