An interval is the distance in terms of frequency between two notes. Intervals can be between simultaneously sounded notes (two-note chords) and between consecutive notes.
With the commonly used diatonic scale in Western music, the smallest interval is a semitone (half-tone). Each of the twelve notes of an octave is separated from its adjacent notes by a semitone, and thus an octave contains twelve semitones.
However, smaller intervals, called microtones, are common in scales used in non-Western music. There is no limit to the number of microtones that are theoretically possible, and they can be so small as to be imperceptible to the human ear.
In Western music there is a name for each size of interval, including minor second for one half-tone, major second or diminished third for two half-tones, minor third for three half-tones, major third or diminished fourth for four half-tones, etc. The names of intervals simultaneously indicate both the number of lines and spaces on the staff separating the two notes and their quality. For example, the major third middle C-E contains two lines (one each for C and E) and one space (for D) and the perfect fourth D-G contains two lines and two spaces.
Intervals are generally considered to be either consonant or dissonant, depending on their size. The former are usually described as pleasant and agreeable, while the latter create tension and a desire to be resolved to consonant intervals.