To convert Hz to a musical note, choose an A4 reference and calculate where the measured frequency falls on an equal-tempered scale. The result is a fractional MIDI position. Round it to find the nearest note and use the remaining fraction to calculate cents. Keep the original Hz and reference with the label.
Convert Frequency to Fractional MIDI
Use n = 69 + 12 × log₂(measured Hz ÷ A4). The MIDI position of the A4 reference is 69. A ratio of one puts the result at 69. A ratio of two raises the result by 12 positions, one octave. The value can lie between integers when the measured pitch is between two notes.
For example, if A4 is 440 Hz, a measurement at 220 Hz has a ratio of one-half. The logarithm is −1, so the result is 57. MIDI note 57 is A3. The musical note frequency chart shows the corresponding keys and their reference frequencies.
Round to a Note and Calculate the Cents Offset
Round the fractional position to the closest integer on the pitch interval scale. Map that integer to its note and octave. The cents difference is 100 × (fractional position − nearest position). A positive difference means the measured frequency is above the nearest reference.
| Measured pitch at A4 = 440 Hz | Nearest reference | Approximate offset |
|---|---|---|
| 220 Hz | A3, MIDI 57 | 0 cents |
| 300 Hz | D4, MIDI 62 | +37 cents |
| 330 Hz | E4, MIDI 64 | +2 cents |
| 440 Hz | A4, MIDI 69 | 0 cents |
Find the note whose distance in cents is smallest. Raw Hz differences use an absolute scale and can select another label in a narrow interval near the midpoint. For an exact tie, document the rounding rule if the selected name matters.
Worked Example From 300 Hz
At A4 = 440 Hz, 300 Hz gives a fractional MIDI position about 62.37. The nearest integer is 62, D4. The difference from that reference is about +37 cents. Carry extra digits until after rounding. The guide to cents explains how the same distance can be calculated from the frequency ratio against D4.
A table can make the nearest reference easy to find. Use the exact reference if you want an offset. A rounded chart value is fine for a quick lookup and can change the last displayed digit if reused in a precision calculation.
Convert a Note Back to Frequency
Use Hz = A4 × 2^((n − 69) ÷ 12). For MIDI 62 at A4 = 440 Hz, the exponent is −7/12 and the result is about 293.66 Hz. That is the D4 reference. Comparing it with 300 Hz gives the same positive deviation from the previous example.
Use the planned frequency to note converter for both directions to check a calculation. If you enter a note name, confirm its octave and spelling. Alternate names can represent the same key in equal temperament. Use the MIDI number to identify the shared position.
Set the Tuning Reference and Validate the Input
A4 controls the whole grid. If it changes from 440 to 442 Hz, all equivalent reference frequencies rise by the same ratio. A measured frequency can stay constant and receive different cents or a neighboring label. See what changing the A4 reference does for a numerical example near a boundary.
A logarithm requires a positive finite frequency and reference. Silence does not give a zero-Hz musical note. Keep an estimate outside the supported MIDI range labeled if you plan to export. Its frequency can still be recorded without forcing it to a wrong key.
Compare a Calculated Result With a Live Reading
Use the pitch identifier to obtain a measured Hz value from a single clear sound. Enter a stable value and use the same A4 reference in both tools. Record whether you used one current estimate or a central summary. A moving note may fall into several reference regions over time.
If tools disagree, check tuning and octave conventions first. Then compare the raw measurements and intervals. A reference calculation takes the frequency you give it, while the live result depends on the signal.
When implementing a repeatable lookup, record whether you round half positions upward, downward or by another documented rule. A value exactly between notes can have two equally close references. A small rounding difference in measured Hz can also change the selected label near this boundary. The input value and reference make that choice reviewable.
Frequently Asked Questions
What is the nearest note to 300 Hz?
At A4 = 440 Hz, it is D4 at just under +37 cents. The measured value and reference belong together when sharing that answer.
Why is the MIDI result a decimal before rounding?
It gives the measured position on a continuous equal-tempered scale. Whole values identify reference notes. The difference from the chosen whole value gives the offset in cents.
What should I enter for silence or an unclear pitch?
Keep the reading missing until you have an estimate. The formula requires a positive frequency and cannot infer a note from a blank reading.