Music Pitch Calculator: Find Note from Frequency
The calculator for this page is switched off while it is checked. The formula is below, and the worked example in the article shows how to use it by hand.
This music pitch calculator converts a frequency in hertz (Hz) into the nearest musical note (e.g., A4, C#5), the note’s octave, and the cents deviation from that note. You enter a frequency, and the calculator returns the closest note name, the octave, and how many cents sharp or flat the pitch is compared to standard tuning (A4 = 440 Hz).
Formula
The calculator uses the standard equal-temperament scale, where each semitone is a factor of 21/12 (about 1.059463) above the previous one. The reference is A4 = 440 Hz.
First, find the MIDI note number for the frequency:
MIDI note = 69 + 12 × log₂(f / 440)
where f is the frequency in hertz. The result is a real number; round to the nearest integer to get the nearest MIDI note. Then convert the MIDI note to a note name and octave using:
- Pitch class = MIDI note mod 12 (0 = C, 1 = C#, 2 = D, … 11 = B)
- Octave = (MIDI note ÷ 12) − 1
Finally, the cents deviation is the difference between the actual frequency and the nearest note’s frequency, in cents:
Cents = 1200 × log₂(f / f_note)
where f_note is the frequency of the nearest note. A positive cents value means the pitch is sharp (higher than the note); negative means flat.
Worked Example
Using the default value of 440 Hz:
- MIDI note = 69 + 12 × log₂(440 / 440) = 69 + 0 = 69
- Nearest note: MIDI 69 → pitch class 69 mod 12 = 9 → A; octave = (69 ÷ 12) − 1 = 5.75 − 1 = 4 (since 69/12 = 5.75, floor is 5, octave = 4). So the note is A4.
- Cents deviation = 1200 × log₂(440 / 440) = 0 cents.
The calculator returns: note = A4, cents = 0, MIDI = 69. Exactly as expected.
How to Use the Calculator
Enter any frequency in hertz (Hz). The calculator works for any positive number, from very low (e.g., 20 Hz) to very high (e.g., 20,000 Hz). The result shows the nearest note in scientific pitch notation (e.g., C4, F#3). The cents value tells you how far off the pitch is from that note: 0 cents is perfectly in tune, 50 cents is a quarter-tone away, and 100 cents is a full semitone away.
This tool is useful for musicians tuning instruments, audio engineers analyzing recordings, or anyone curious about the pitch of a sound. For example, if you measure a frequency of 261.63 Hz, the calculator will show C4 (middle C).
Background: Why 440 Hz?
The standard tuning pitch of A4 = 440 Hz was adopted internationally in 1955 (ISO 16). Before that, different orchestras used different references, ranging from about 415 Hz to 466 Hz. Some modern ensembles use 442 or 443 Hz for a brighter sound. The calculator uses 440 Hz as the default, but you can adjust the reference if you need a different standard (e.g., for Baroque tuning at 415 Hz).
The equal-temperament system divides the octave into 12 equal semitones, which is why the formula uses 21/12. This is the most common tuning system in Western music, but other systems (just intonation, Pythagorean) exist and would give slightly different note frequencies.
Common Mistakes and Misconceptions
- Mixing up octave numbering: In scientific pitch notation, middle C is C4, and A4 is 440 Hz. Some systems (like MIDI) number octaves differently. The calculator uses scientific pitch notation.
- Rounding errors: The cents deviation is a logarithmic measure; a frequency ratio of 2:1 equals 1200 cents. A small frequency difference near the note can be a large cents difference. For example, 440 Hz vs 441 Hz is about 3.93 cents, not 1 cent.
- Assuming every note is exactly at a whole-number frequency: In equal temperament, only A4 is exactly 440 Hz (by definition). Other notes are irrational multiples, so they are often rounded to two decimals (e.g., C4 = 261.63 Hz).
- Confusing pitch with frequency: Pitch is a perceptual attribute, while frequency is a physical one. The calculator converts frequency to note names based on the equal-temperament scale, but actual perceived pitch can vary slightly with loudness and duration.
How to Choose a Reference Frequency
If you are tuning an instrument to a specific standard, set the reference to that standard. Common references:
- 440 Hz – modern concert pitch (ISO 16)
- 442 Hz – used by many European orchestras
- 415 Hz – Baroque pitch (about a semitone lower than modern)
- 432 Hz – sometimes used in alternative tunings
To change the reference, you would need to modify the formula (the calculator currently uses 440 Hz fixed). If you need a different reference, you can recalculate manually using the formula with the new reference.
Limits of the Formula
The formula assumes equal temperament and a fixed reference. It does not account for:
- Just intonation or other tuning systems
- Human pitch perception (which can be influenced by timbre and context)
- Microtonal scales that divide the octave into more than 12 parts
For most practical purposes, the equal-temperament approximation is accurate enough for tuning and analysis.
Frequently Asked Questions
What is a cent in music?
A cent is a unit of musical interval equal to 1/100 of a semitone. There are 1200 cents in an octave. It is a logarithmic measure, so a frequency ratio of 2:1 is 1200 cents. The cents deviation tells you how far a pitch is from the nearest note in equal temperament.
How do I convert a MIDI note number to frequency?
The formula is: frequency = 440 × 2((MIDI − 69) / 12). For example, MIDI 60 (C4) gives 440 × 2(−9/12) ≈ 261.63 Hz.
What is the difference between pitch and frequency?
Frequency is a physical property of a sound wave, measured in hertz. Pitch is the perceptual quality that allows us to order sounds on a musical scale. While they are closely related, pitch can be affected by factors like loudness and duration, so the mapping is not always linear.
Why does the calculator show a negative cents value?
A negative cents value means the frequency is lower (flat) than the nearest note. For example, 430 Hz is about −39.7 cents relative to A4, because it is below 440 Hz.
Can I use this calculator for tuning a guitar?
Yes, you can. If you pluck a string and measure its frequency (e.g., with a tuner app), you can enter that frequency here to see how close it is to the intended note. For example, the low E string on a guitar is E2 ≈ 82.41 Hz.
Does the calculator work for frequencies outside the audible range?
Yes, mathematically it works for any positive frequency. However, notes below 20 Hz or above 20 kHz are not audible to humans, but they are still valid for scientific or electronic music purposes.
Related
Formula used
in f | Frequency | Hz | 440 | 1 out note | Nearest note | - | note_name | 0 out cents | Cents deviation | cents | cents_dev | 1 out midi | MIDI note number | - | midi_num | 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.