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

How to recognize a perfect 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 A♭ / E♭:
Let's take the A flat Major scale to have A♭ as the tonic:

From the rule stated above, it becomes clear that A♭ / E♭ is a perfect fifth.
Inversion of the perfect fifth
The inversion of the perfect fifth is the perfect fourth.
Here is an example of a perfect fourth:

Musical examples of perfect fifth
Prelude to Suite No.1 for cello by J.S. BACH
The Prelude to Suite No. 1 for cello by J.S. BACH begins with a perfect fifth:

Fugue in G minor BWV 578 by J.S. BACH
J.S. BACH's Fugue in G minor BWV 578 begins with a perfect fifth:

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