Cents between frequencies calculator
From 440 Hz to 880 Hz is 1200 cents, exactly one octave with a ratio of 2. Enter any two frequencies to get the signed interval in cents and check a tuning, a pitch bend or a just-intonation exercise. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- First frequency in hertz
- 440
- Second frequency in hertz
- 880
- Cents
- 1,200 cents
- Abs cents
- 1,200
- Ratio
- 2
A cents between frequencies calculator turns two pitch heights into the single logarithmic distance musicians and audio engineers actually use. Enter a first frequency f1 and a second frequency f2 in hertz (or any shared unit); the tool returns the signed interval in cents using the closed formula twelve hundred times log base two of f2 over f1, the absolute interval for magnitude-only workflows, the frequency ratio, and step-by-step substitution you can recompute by hand.
What cents measure and why log2 of a frequency ratio
Human pitch perception is approximately logarithmic in frequency: an octave is a doubling of frequency, not a fixed number of hertz. The cent is one twelve-hundredth of an octave, so an exact octave interval always equals twelve hundred cents regardless of where it sits on the keyboard. The defining relation is cents equals twelve hundred times the base-two logarithm of the frequency ratio f2 over f1.
Equivalent forms use the natural logarithm: twelve hundred times ln of the ratio divided by ln of two, which is how floating-point implementations evaluate log2 without a dedicated log2 primitive. Positive cents mean f2 is higher than f1; negative cents mean f2 is lower; zero cents is a unison when the two frequencies match after rounding. Equal temperament places twelve equal semitones in each octave, so one semitone is exactly one hundred cents and a perfect fifth in equal temperament is seven hundred cents.
Just intonation ratios such as three-to-two produce different cent values—about seven hundred one point nine five five for a pure fifth—which is exactly why a cents calculator is useful when comparing tunings. Rejecting zero and negative frequencies is mandatory: the ratio would be undefined or non-positive, and the logarithm would leave the real line.
Practical tips, limits, and related searches
Prefer sending numbers rather than pre-formatted strings when you control the client; string numbers are accepted only when they match a strict finite numeric pattern. For synthesizer pitch-bend calibration, compare the cents result against the bend range in cents your instrument claims; for just-intonation drills, feed pure ratios such as five-to-four or three-to-two and compare against equal-tempered targets.
This landing targets people searching for a cents between frequencies calculator, musical interval in cents from hertz, or pitch difference log2 converter; it is not a MIDI note number mapper, not a pitch detector for audio files, not a waveform generator, and not a named-interval labeler that prints fifth or major third. Prefer this capability when you already know two frequencies and only need the cent distance; if your source is a recording, detect or measure frequencies first.
What you can do with it
Compare instrument tunings and reference pitches
Musicians enter a measured open-string frequency and a target A440-based pitch to see how many cents sharp or flat the instrument is.
Verify synthesizer pitch-bend and detune ranges
Sound designers feed base and bent oscillator frequencies and confirm the cent offset matches the plugin bend range before automating.
FAQ
What is one equal-tempered semitone in cents?
Exactly 100 cents. Equal temperament divides the octave into twelve equal log-frequency steps, so each step is 1200/12 = 100.
What happens if a frequency is zero or negative?
A log-frequency interval is only defined for strictly positive frequencies.
Does a negative cents value mean something is wrong?
No. Negative cents only means f2 is lower than f1.
Is the cents between frequencies calculator free?
The browser tool is free and runs locally.
How many cents is 440 Hz to 880 Hz?
It is 1200 cents, one full octave, because the second frequency is exactly twice the first. The result is positive since the second note is higher; going from 880 Hz down to 440 Hz gives the same size with a minus sign.
Related tools
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/hobby/cents-interval \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"f1":440,"f2":880}'const res = await fetch("https://api.kit.forhosting.com/hobby/cents-interval", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"f1": 440,
"f2": 880
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/hobby/cents-interval",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"f1": 440,
"f2": 880
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/hobby/cents-interval", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"f1":440,"f2":880}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"f1":440,"f2":880}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/hobby/cents-interval", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"f1": 440,
"f2": 880
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "hobby.cents_interval",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Limits
max_abs | 1000000000000 |
min_freq | 1e-12 |
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
Technical notes
Zero or negative frequencies are rejected with a clear invalid_input error, because a log-frequency scale has no meaning when either side is not strictly positive.
What cents measure and why log2 of a frequency ratio
Absolute caps keep intermediate products finite in IEEE double precision on the Worker and in the browser.
How to call the API and what comes back
The steps array walks from the raw frequencies through the ratio, the log formula, the absolute interval, and the summary line so you can assert intermediate values in tests or worksheets. Typical studio checkpoints include four hundred forty hertz to eight hundred eighty hertz for a clean twelve-hundred-cent octave, and four hundred forty hertz to about four hundred sixty-six point one six four hertz for a one-hundred-cent equal-tempered semitone. Send a JSON body with two required finite numbers: f1 (aliases freq1, frequency1, from_hz, and from) and f2 (aliases freq2, frequency2, to_hz, and to). Each absolute value must stay within the published limit of one trillion, and each value must be strictly greater than zero; values at or below zero, missing fields, non-numeric strings, and non-finite numbers return invalid_input and are never charged. On success the response echoes rounded f1 and f2, sets cents to the signed interval, abs_cents to the absolute value of that interval, ratio to the rounded f2 over f1 quotient, unit to the string cents, formula to the closed relation cents equals twelve hundred times log2 of f2 over f1, and message to a short English summary that states direction (upward, downward, or unison). Pricing is a flat $0.002 per successful request with unit item and zero marginal unit price.
Practical tips, limits, and related searches
Keep both frequencies inside the published absolute range so the ratio and logarithm stay finite in IEEE double precision. When teaching, pair a positive happy path with a deliberate zero or negative frequency to demonstrate the hard invalid_input path, and confirm that swapping f1 and f2 only flips the sign of cents while abs_cents stays the same. Failed tasks that return invalid_input do not consume prepaid balance, which keeps exploratory scripts cheap when learners deliberately probe edge cases. Round-trip checks are straightforward: recompute twelve hundred times log2 of f2 over f1 by hand or in a spreadsheet and confirm it equals the published cents field within twelve-decimal rounding, and confirm that abs_cents equals the absolute value of cents.
Integration use cases
Unit tests for tuning libraries and microtonal tools
Developers assert octave, semitone, and just-interval fixtures against deterministic cents outputs without audio hardware or wall-clock timers.
Technical questions
How many cents are in an octave?
Exactly 1200. An octave is a 2:1 frequency ratio, and cents = 1200 × log2(2) = 1200.