Melodic Inversion Calculator

Melodic inversion is a transformation technique where intervals are flipped: ascending becomes descending, and vice versa. It's a powerful compositional tool used from Bach's counterpoint to Schoenberg's twelve-tone rows to film scores.

Enter a melody below using note names (C, D#, Bb) or integers (0-11), choose your inversion axis, and see the transformation instantly.

Enter Your Melody

Format:
Use: C, C#, Db, D, D#, Eb, E, F, F#, Gb, G, G#, Ab, A, A#, Bb, B
Inversion Axis

Formula: Inverted = (2 × Axis) - Original mod 12

Try an example:

Original

Invert around 0

Inverted

Visual Comparison

See how intervals flip
🎼

Why Invert a Melody?

Counterpoint & Fugue

Bach's fugues use inversion to create new countersubjects. An ascending theme becomes descending, maintaining intervallic relationships while creating contrast.

Thematic Development

Beethoven and Brahms transform motifs through inversion to build entire symphonic movements from a single idea, creating unity through variation.

Twelve-Tone Technique

Schoenberg's method requires four row forms: Prime (P), Retrograde (R), Inversion (I), and Retrograde-Inversion (RI). Inversion is fundamental to serial composition.

Film & Game Scoring

John Williams inverts leitmotifs to suggest transformation—a hero's theme inverted for their dark moment, then restored in triumph.

📖

How Melodic Inversion Works

+
1

Convert Notes to Pitch Classes

Each note maps to a number 0-11, ignoring octave:

C0 C#/Db1 D2 D#/Eb3
E4 F5 F#/Gb6 G7
G#/Ab8 A9 A#/Bb10 B11
2

Choose an Axis

The axis is the "mirror 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: Symmetric around tritone. C↔C and F#↔F# are fixed points.
  • First note: Some composers invert around the melody's starting pitch.
3

Apply the Formula

For each note, calculate:

Inverted Pitch = (2 × Axis - Original) mod 12

The "mod 12" means we wrap around: if you get -2, add 12 to get 10 (Bb).

Worked Example: Invert C-E-G around axis 0

C (0) (2×0) - 0 = 0 → C (0)
E (4) (2×0) - 4 = -4 → 8 → Ab (8)
G (7) (2×0) - 7 = -7 → 5 → F (5)
Result: C-E-G → C-Ab-F (C major becomes F minor!)
💡

Key Insight: Intervals Flip Direction

The beauty of inversion: 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 "shape" is mirrored, not destroyed

This is why inverted themes sound related but different—they preserve the melodic character while reversing its motion.

Famous Examples of Inversion

J.S. Bach The Art of Fugue

Contrapunctus III and IV are inversions of each other. The entire fugue subject is flipped, demonstrating Bach's mastery of invertible counterpoint.

Beethoven Symphony No. 5

The famous "fate" motif (G-G-G-Eb) appears inverted throughout the symphony, creating thematic unity while allowing development.

Webern Symphony Op. 21

Built entirely on a twelve-tone row and its transformations. The row is designed so that its inversion is also its retrograde transposed—extreme economy.

John Williams Star Wars

The Imperial March contains melodic cells that invert the heroic Force Theme intervals, musically portraying the dark side as a twisted reflection.

Video Tutorial

How to Invert Music by Hand