help-calc

02 Music and Audio

Chord Calculator Math: How to Build Any Chord

Card 02-0191 · Updated · Standard formula, shown below

The calculator on this page is switched off while it is checked. The formula is below, and the worked example shows how to do the sum by hand.

A chord calculator works out the notes in a musical chord from its root note and chord quality using the intervals of the major scale. You enter the root (say C) and the chord type (major, minor, dominant 7th, etc.), and it returns the exact note names that make up that chord. The math behind it is simple interval arithmetic: each chord quality is defined by a fixed set of semitone steps above the root.

Formula

The core formula for any chord is:

Chord notes = Root + interval pattern (in semitones)

Where the interval pattern is a list of semitone offsets from the root. For example:

  • Major: [0, 4, 7] (root, major third, perfect fifth)
  • Minor: [0, 3, 7] (root, minor third, perfect fifth)
  • Diminished: [0, 3, 6] (root, minor third, diminished fifth)
  • Augmented: [0, 4, 8] (root, major third, augmented fifth)
  • Dominant 7th: [0, 4, 7, 10] (root, major third, perfect fifth, minor seventh)
  • Major 7th: [0, 4, 7, 11] (root, major third, perfect fifth, major seventh)
  • Minor 7th: [0, 3, 7, 10] (root, minor third, perfect fifth, minor seventh)

Each semitone is one half-step on a piano. The root is given as a MIDI note number (60 = middle C, 61 = C#, 62 = D, etc.). To get the actual note name, convert the MIDI number to a pitch class: MIDI number modulo 12 gives the note (0=C, 1=C#, 2=D, …, 11=B).

Worked Example

Let’s build a C major chord using the default values: root = 60 (C), quality = Major.

  1. Start with the root: 60.
  2. Add the major third interval: 60 + 4 = 64 (E).
  3. Add the perfect fifth interval: 60 + 7 = 67 (G).
  4. The chord notes are 60, 64, 67, which are C, E, G.

The calculator returns 60, 64, 67 for the default input, matching the expected C major triad.

How the Math Works: Intervals and Semitones

Western music divides the octave into 12 equal semitones. A chord is defined by the intervals between its notes, measured in semitones. The interval pattern for a chord quality is always the same regardless of the root. For example, a major chord is always root + 4 semitones + 7 semitones. This is why you can transpose a chord by simply adding the same number to every note.

The calculator uses MIDI note numbers because they are simple integers. Each step up is one semitone. To convert a MIDI number to a note name, use the modulo operation: note = midi % 12. For example, 60 % 12 = 0, so C. 61 % 12 = 1, so C#. The octave is determined by integer division: midi / 12 – 1 gives the octave number (60/12 – 1 = 4, so C4).

Choosing the Right Chord Quality

The chord quality determines the emotional color of the chord. Here’s a quick guide:

  • Major: Bright, happy, stable. Used in most pop, rock, and classical music.
  • Minor: Sad, dark, melancholic. Common in blues, rock, and ballads.
  • Diminished: Tense, dissonant. Often used as a passing chord or to create suspense.
  • Augmented: Mysterious, unresolved. Rare, but used in jazz and film scores.
  • Dominant 7th: Bluesy, jazzy. The most common 7th chord, used to create tension that resolves to the tonic.
  • Major 7th: Dreamy, jazzy. Common in jazz and neo-soul.
  • Minor 7th: Mellow, smooth. Used in funk, R&B, and jazz.

If you’re writing a song, start with major or minor triads. Add a 7th for more color. Use diminished or augmented sparingly for effect.

Common Mistakes and Misconceptions

One common mistake is confusing the interval numbers (like “third” and “fifth”) with semitone counts. A “major third” is 4 semitones, not 3. A “perfect fifth” is 7 semitones, not 5. The names come from the diatonic scale, not the chromatic scale.

Another misconception is that a chord must contain only the notes in its interval pattern. In practice, you can double notes (play the same note in a different octave) or omit the fifth (common in guitar playing) and still have the same chord. The interval pattern defines the essential notes, but the voicing can vary.

Also, be careful with enharmonic equivalents. For example, C# major and Db major are the same notes on a piano but have different spellings. The calculator returns MIDI numbers, which don’t distinguish between enharmonic spellings. If you need note names, you’ll have to choose the spelling based on the musical context.

Limits of the Formula

The interval pattern method works for any chord that can be built from stacked thirds (which covers most common chords). However, it doesn’t handle chords with added tensions (like 9ths, 11ths, 13ths) unless you extend the pattern manually. For example, a dominant 9th chord is [0, 4, 7, 10, 14] (add the 9th, which is a whole step above the octave). The calculator above only covers the most common qualities, but you can easily add more by editing the pattern.

The calculator also assumes equal temperament tuning, which is standard on pianos and most digital instruments. If you’re using just intonation or other tuning systems, the semitone intervals will be slightly different.

How to Use the Calculator Effectively

To get the most out of this tool:

  • Enter the root as a MIDI number. If you know the note name, convert it: C=60, C#=61, D=62, etc. (add 12 for each octave up).
  • Select the chord quality from the dropdown.
  • The output shows the MIDI numbers of the chord notes. To get note names, use the modulo trick or look up a MIDI note chart.
  • If you want to transpose, just add or subtract the same number from all notes.

For example, to find the notes of an F# minor chord, enter root = 66 (F#4) and quality = Minor. The calculator returns 66, 69, 73, which are F#, A, C#.

Frequently Asked Questions

How do I convert MIDI numbers to note names?

Take the MIDI number modulo 12. The result maps to a note: 0=C, 1=C#, 2=D, 3=D#, 4=E, 5=F, 6=F#, 7=G, 8=G#, 9=A, 10=A#, 11=B. The octave is (MIDI / 12) – 1. For example, MIDI 60: 60 % 12 = 0 (C), 60/12 – 1 = 4, so C4.

Why does a major chord have 4 semitones for the third?

Because in the major scale, the third note is 4 semitones above the root. This interval is called a major third. The fifth is 7 semitones above the root, called a perfect fifth. These intervals are fixed in equal temperament.

Can I use this calculator for guitar chords?

Yes, the math is the same. The calculator gives you the notes in the chord. On guitar, you can play those notes in various positions. Just remember that some chord voicings omit the fifth or double the root.

What is the difference between a major 7th and a dominant 7th?

A major 7th chord has a major seventh interval (11 semitones) above the root, while a dominant 7th has a minor seventh (10 semitones). For example, Cmaj7 = C, E, G, B; C7 = C, E, G, Bb. The dominant 7th sounds more bluesy and tense.

How do I add more complex chords like 9ths or 13ths?

Extend the interval pattern. A dominant 9th is [0, 4, 7, 10, 14] (add the 9th, which is the second note an octave up). A 13th chord adds the 13th (21 semitones). You can modify the calculator’s expression to include these, but it’s easier to use a dedicated chord calculator for extended chords.

Does the calculator work for any root note?

Yes, as long as the MIDI number is between 0 and 127 (the standard MIDI range). The math is the same for any root. Just add the interval pattern to the root number.

Related

Formula used
in root | Root note (MIDI number) | - | 60 | 0 | 127
sel quality | Chord quality | Major=0, Minor=1, Diminished=2, Augmented=3, Dominant 7th=4, Major 7th=5, Minor 7th=6 | 0
out notes | Chord notes (MIDI) | - | root + [0,4,7] * (quality == 0) + [0,3,7] * (quality == 1) + [0,3,6] * (quality == 2) + [0,4,8] * (quality == 3) + [0,4,7,10] * (quality == 4) + [0,4,7,11] * (quality == 5) + [0,3,7,10] * (quality == 6) | 0
out name | Chord name | - | root + quality | 0

Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.

More on this shelf

The whole Music and Audio shelf →