A semitone or half step or half tone is the smallest musical relevant step (interval) in pitch that is used on most instruments and in (Western) tonal music.
An octave in this context is made up of twelve equal semitone steps.
In written music, it is not immediately obvious what the interval is; the distance between two note-positions can vary.
|gb - g#||2|
|g - g#||1|
|gb - g||1|
|g - g||0|
Note-distance in semitones shown in red.
Scale position in blue.