Melodic Inversion Calculator
Melodic inversion flips every interval in a melody, so ascending becomes descending and vice versa. It is used in Bach's counterpoint, Schoenberg's twelve-tone rows, and film scores.
Enter a melody below using note names (C, D#, Bb) or integers (0-11), and choose an inversion axis.
Enter Your Melody
Formula: Inverted = (2 × Axis) - Original mod 12
Original
Inverted
Visual Comparison
See how intervals flipWhy Invert a Melody?
Counterpoint & Fugue
In some of Bach's fugues the subject comes back upside down. An ascending theme becomes descending but keeps the same intervals.
Thematic Development
Beethoven and Brahms invert motives when they develop a theme.
Twelve-Tone Technique
Schoenberg's method requires four row forms: Prime (P), Retrograde (R), Inversion (I), and Retrograde-Inversion (RI).
Film & Game Scoring
A composer can invert a character's theme to show that something has changed.
How Melodic Inversion Works
How Melodic Inversion Works
Convert Notes to Pitch Classes
Each note maps to a number 0-11, ignoring octave:
Choose an Axis
The axis is the point around which notes reflect. Common choices:
- Axis 0: Standard in post-tonal analysis. C stays C, but E(4) becomes Ab(8).
- Axis 6: Gives the same notes as axis 0, because 2 × 6 = 12, which is 0 mod 12. Both leave C and F# unchanged.
- First note: Some composers invert around the melody's starting pitch.
Apply the Formula
For each note, calculate:
Inverted Pitch = (2 × Axis - Original) mod 12
The "mod 12" means you wrap around: if you get -2, add 12 to get 10 (Bb).
Worked Example: Invert C-E-G around axis 0
Intervals Flip Direction
Every interval flips direction but keeps its size.
- An ascending major 3rd (C→E) becomes a descending major 3rd (C→Ab)
- A leap up of 7 semitones becomes a leap down of 7 semitones
- The melody's contour is mirrored
An inverted theme sounds related to the original because the intervals are the same, and different because every one of them moves the other way.
Famous Examples of Inversion
Contrapunctus III and IV use the subject upside down. XII and XIII are mirror fugues, in which the whole piece can be inverted.
The melody of Variation 18 is Paganini's theme upside down, in a major key and slower.
Built entirely on a twelve-tone row and its transformations. The row is the same backwards as forwards, transposed by a tritone.
After the climax of the first movement, the fugue subject comes back inverted. Near the end, both forms are played together.