GestureSynth.me

Music calculator

Frequency to MIDI Converter

Convert a frequency in hertz into its nearest MIDI note, pitch name, and tuning offset in cents.

frequency to midi converter

Frequency to MIDI Converter guide

Reading a tuner or spectrum display gives you hertz. A piano roll uses MIDI numbers. The conversion assumes twelve-tone equal temperament and lets you change the A4 reference used by your project.

Play the instrument ↑
Example
At A4 = 440 Hz, 440 Hz is MIDI 69 and 880 Hz is MIDI 81. Enter 442 Hz with A4 still at 440 to see roughly eight cents above MIDI 69. If your session is tuned to A4 = 442, change the reference and the offset returns to zero.

Formula and units

Nearest MIDI = round(69 + 12 × log₂(Hz ÷ A4)). The unrounded value shows how far between two MIDI notes a frequency sits. The cent offset is measured from the rounded note, not from A4.

Worked examples

At A4 = 440 Hz, 440 Hz is MIDI 69 and 880 Hz is MIDI 81. Enter 442 Hz with A4 still at 440 to see roughly eight cents above MIDI 69. If your session is tuned to A4 = 442, change the reference and the offset returns to zero.

How to use the result

Use the nearest integer when entering a piano-roll note. Carry the offset separately if your synth supports fine tuning or pitch bend. A spectrum may show a harmonic louder than the fundamental, so confirm the measured frequency before mapping it.

Map a measured pitch to a piano roll

Suppose a tuner shows 445 Hz while the session uses A4 = 440 Hz. Enter 445 and leave the reference at 440. The closest note remains A4, MIDI 69. The offset is about +19.6 cents, so transcribing the note as MIDI 69 alone loses that small difference. If the receiving sampler exposes fine tune, use the offset there. If you are building a keyboard mapping, keep each zone anchored to its actual recorded pitch so the instrument does not drift from one sample zone to another.

To check a low pitch, use a sustained section of the sound and measure several cycles. A plucked note can start sharp and settle after the attack. A bass may produce a weak fundamental while the first audible overtone dominates a spectrum. If the converter suddenly jumps by twelve MIDI notes, compare the displayed frequency with half or twice that value. An octave shift in the measured frequency should move the MIDI number by twelve while keeping the same fractional position.

Check the reference and nearest-note boundary

A4 can be 440 Hz in one project and 442 Hz in another. Write down the reference with the result so a collaborator can reconstruct it. The same frequency near an equal-tempered boundary may round to different notes under those references. The boundary is 50 cents from either adjacent note, so it falls at their geometric mean. For A4 and A♯4 at the default tuning, the dividing frequency is about 452.893 Hz.

Near that boundary, a tiny input change can switch the nearest note and flip the sign of the residual. This is expected: +49 cents above the lower note and −49 cents below the upper note describe two different sides of the same small region. Keep the frequency or fractional MIDI value when the boundary matters, instead of retaining only the rounded number.

Compare the two available reference tones

Use Hear entered frequency for the measurement and Hear nearest note for the pitch produced by the rounded MIDI number. When the offset is small the tones sound close, especially played separately. For a clearer difference, try 453 Hz first, then return to the input you are checking. Preview buttons only appear for tones within the tool's audible preview range. MIDI numbers can still be valid at the very low or high end where a small speaker or browser preview is impractical.

Answers before you play

Common questions

What if the note number is out of range?

Standard MIDI note numbers run from 0 through 127. Frequencies whose nearest note is outside that range produce an input message.

What MIDI number is middle C?

At A4 = 440 Hz, middle C is approximately 261.625565 Hz and uses MIDI number 60. This tool displays it as C4. Some DAWs label the same numbered note C3 or C5, so match by the number when octave labels disagree.

Can fractional MIDI be sent directly as a Note On?

An ordinary MIDI 1.0 Note On uses a whole note number. To preserve the fractional pitch, use a receiving instrument that supports a separate tuning mechanism, such as pitch bend or a tuning configuration.

Can it analyze a recording or microphone?

Enter a measured frequency yourself. The page converts numeric input and can synthesize comparison tones. A tuner or spectrum tool is the separate step that measures pitch from sound.