Music Key Finder
Identify the most likely key of a set of notes and see the scale and relative minor.
Last updated · View algorithm, constants and default inputs (JSON)
About this calculator
A set of notes usually fits several major scales, so the reliable method is to score each key by how many of your notes it contains and pick the best fit. The relative minor always shares the same notes, which is why a song can be described as either.
Worked example
calculated with the default values below
Notes in the song (space separated) C D E F G A · Prefer sharps or flats Sharps Most likely key C major · Notes of your set inside the scale 6 · Confidence 100 % · Relative minor A minor · Notes in the scale C D E F G A B · Runner-up keys F (6), G (5), A# (5)
General background references
Disclaimer
These calculators give general estimates. Sizing, pricing, availability and standards vary by brand, retailer and country, so treat the output as a starting point and confirm it against the seller's or authority's own figures.
Implementation source
This record describes the implementation used by this page. It is not independent validation. External references, when available, support only the stated formula or definition; estimates and custom rules retain their own assumptions.
Formula and variables
N = {n_1,…,n_m}; S_r = {(r+k) mod 12 : k ∈ {0,2,4,5,7,9,11}}; hits(r) = |{j ∈ {1,…,m} : n_j ∈ S_r}|; score(r) = hits(r) + {0.5, r ∈ N; 0, r ∉ N}; key = argmax_{r ∈ {0,…,11}} score(r)
- r
- candidate root pitch class 0–11
- n_j
- pitch class of the j-th input note
- m
- number of input notes
- N
- set of distinct input pitch classes
- S_r
- major-scale pitch-class set for root r
- hits
- input notes inside scale
- score
- match score for root
Accepts 1–64 whitespace-, comma-, or semicolon-separated note names A–G with optional # or b; malformed/empty lists are rejected. Scores all 12 major keys by matching entered pitch classes plus a small tonic bonus. A high score is a heuristic, not a tonal analysis.
Frequently asked questions
What note names can I enter?
Enter 1–64 note names using A–G, optionally followed by # or b, separated by spaces, commas, or semicolons. Invalid tokens are rejected rather than ignored. The key ranking is a pitch-class heuristic and cannot replace chord, melody, or tonal-context analysis.
Can this tool tell C major from A minor?
It scores only twelve major scales by counting how many entered notes belong to each and adding a small bonus when the tonic itself is present. It reports the relative minor of its highest-ranked major scale, but does not score minor keys independently or use note order, duration or emphasis. C major and A minor share the same notes, so the result is only a scale-match clue.