Music: Practice & Theory Stack Exchange is a question and answer site for musicians, students, and enthusiasts. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Let's say I have the note A 440Hz and the frequency 450Hz. How do I calculate the distance in cents between that note and that frequency?

share|improve this question
up vote 5 down vote accepted

c = 1200 × log2(f1/f0)

The frequency f of a note n semitones away from A4 is (Wikipedia):

f = 2n/12 × 440 Hz

More generally, to calculate one frequency from another based on their distance in semitones:

f1 = 2n/12 × f0

To answer your question, solve for n to get semitones:

n = 12 × log2(f1/f0)

And multiply by 100 for cents:

c = 1200 × log2(f1/f0)

Given your example, the distance in cents between 440 Hz and 450 Hz:

c = 1200 × log2(440/450)
c = –38.9

so 440 Hz is about 39 cents below 450 Hz.

For more information, see the mathematics of musical scales. There’s also some information about the logarithmic scale in the linked entry for musical cents.

share|improve this answer

The first formula shown on you wiki link is the one you want:

From wiki:

""If one knows the frequencies a and b of two notes, the number of cents measuring the interval from a to b may be calculated by the following formula (similar to the definition of decibel):

enter image description here

Likewise, if one knows a note a and the number n of cents in the interval from a to b, then b may be calculated by:

enter image description here

E.G. for your given two frequencies, 440Hz and 450Hz

3986*log(450/440)= 38.9 cents

and in the other direction:

3986*log(440/450)= -38.9 cents

And checking our answer with the second formula:

440*2^(38.9/1200) = 450.0 Hz

share|improve this answer
+1 for putting it in functions you can actually find on a calculator. However it might be worth pointing out that log2(b/a) = log10(b/a)/log10(2) = ln(b/a)/ln(2). Thus the correct value of the constant 3986 is 1200/log10(2)=3986.31371 etc. The fundamental maths is easier to remember than a mysterious constant. – Level River St May 17 '14 at 3:41

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.