Intervals have two features. The distance between the two notes, and the quality of the interval. Quality: perfect, major, minor, diminished, and augmented.
There are several ways of calculating the width of intervals. The quickest and most intuitive is by applying your knowledge of major and minor scales. The major scale consists of a M2, M3, P4, P5, M6, and M7. The natural minor has a m3, m6, and m7. If you know all the key signatures and scales thoroughly, you know the core intervals. When these are made a half-step narrower, they are minor or diminished. If they are a half-step wider, they are augmented.
Inverting an interval is the process of putting the top note on the bottom. To invert the number of an interval, subtract it from 9. Change the quality of an inverted interval from major (M) to minor (m) and vice versa. For example, a M3 becomes a m6 when inverted. An augmented 4th becomes a diminished 5th when inverted.