The major scale has a number: 2741. Type it into https://ianring.com/musictheory/scales/2741 and you land on a page titled "The Major Scale." That number is not arbitrary. 2741 is the major scale, encoded as a single integer. Every scale has its own number, and the number tells you exactly which semitones are in and which are out. Once you can read the encoding, half of music theory turns into bit twiddling. The convention falls out of a much older idea — pitch-class set theory — and Ian Ring's encyclopedia happens to be the most accessible place on the web to see it applied to every scale that fits in twelve semitones.
Twelve bits, one octave
Western music divides the octave into twelve equal semitones. Each semitone gets a bit. Bit 0 is the root. Bit 1 is the minor second. Bit 2 is the major second. And so on up to bit 11, the major seventh. A 1 means "this note is in the scale." A 0 means "this note is out." A scale is a twelve-bit pattern with bit 0 always set, and the scale number is just the binary pattern read as a decimal — bit 0 is the least significant bit.
Decoding 2741
Convert 2741 to binary:
2741 in decimal
= 2048 + 512 + 128 + 32 + 16 + 4 + 1
= 0b101010110101
bit: 11 10 9 8 7 6 5 4 3 2 1 0
bin: 1 0 1 0 1 0 1 1 0 1 0 1Now read each set bit as a semitone above the root. The 1s appear at bit positions 0, 2, 4, 5, 7, 9, and 11. Built off C, those bits correspond to:
bit 0 → C (root)
bit 2 → D (major 2nd)
bit 4 → E (major 3rd)
bit 5 → F (perfect 4th)
bit 7 → G (perfect 5th)
bit 9 → A (major 6th)
bit 11 → B (major 7th)Seven notes — the familiar C D E F G A B. The interval pattern between consecutive notes is W W H W W W H — the textbook definition of the major scale. 2741 is just a more compact way of writing the same fact.
Why this particular pattern feels stable
The major scale is not happy by decree, it is happy because of how its intervals line up with physics. Pluck a string tuned to C and you get a fundamental plus a series of overtones at integer multiples of the fundamental. The first several partials are, in order: C, C, G, C, E, G, B♭, C, D, E. Four of the seven major-scale notes — C, D, E, and G — appear directly inside the first ten partials of a single struck C. The major third (the fifth partial) and the perfect fifth (the third partial) are especially close to the bottom of the stack, which is why a C major triad rings cleanly: its notes are already inside the sound of any single C.
The scale also distributes its half-steps. The two half-steps (E-F and B-C) sit four whole-steps apart, which gives the scale a strong sense of forward motion: the seventh (B) pulls up to the root, the third (E) pulls down to F and back. Move either half-step and the gravity of the scale collapses. The harmonic minor moves the seventh up a half-step and the scale tilts toward suspense. The Hungarian minor adds a raised fourth and the whole thing reads as a different musical language.
Try it
The fastest way to feel how the encoding works is to look up a scale you already know and decode its number. The natural minor is 1453. The harmonic minor is 2477. The melodic minor (ascending) is 2733. Convert any of them to binary, line up the bits with semitones above the root, and check that the notes match what you would write on staff paper.
Then pick a number you do not recognize and visit its page on https://ianring.com/musictheory/scales/. Ring has a name and an analysis for every one of the 4096 possible scales. Most of them sound terrible, but every so often you find a real one with seven notes nobody told you about. That is where this goes. The major scale's home page — https://ianring.com/musictheory/scales/2741 — is a good place to start exploring siblings: its modes, its complement, its imperfections, all annotated.

