Semitone calculator
Concert A at 440 Hz lands on A4 with 0 cents, while 445 Hz is still A4, a few cents sharp: enter any frequency to get the nearest note, its octave and how far sharp or flat the tone is. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Frequency
- 440
- Reference
- 440
- Octave
- 4
- Full name
- A4
- Cents
- 0
A semitone calculator maps a measured frequency in hertz onto the nearest twelve-tone equal-temperament note and reports how many cents that tone sits sharp or flat of that pitch under a chosen concert reference. Musicians, luthiers, audio engineers, and physics teachers often hold a tuner reading or a spectrum peak but need the named pitch plus a signed cents deviation they can trust on every run. This tool uses the closed MIDI formula sixty-nine plus twelve times log base two of frequency over A4, rounds to the nearest integer semitone, and multiplies the remainder by one hundred for cents. Concert A at four hundred forty hertz lands on A4 with zero cents; a slightly sharp four hundred forty-five hertz stays on A4 a handful of cents above the reference.
What a semitone is and how frequency maps onto a named pitch
A semitone is the smallest step in twelve-tone equal temperament: twelve equal logarithmic steps fill one octave, so each step multiplies frequency by the twelfth root of two. Named pitches on a piano are exactly those steps once a concert reference for A4 is chosen. Given a measured frequency in hertz, this calculator answers two linked questions at once: which named note is the nearest semitone, and how many cents the measurement sits sharp or flat of that note.
Cents are one-hundredths of a semitone, so a result near zero means the tone is in tune with the named pitch, plus fifty would be halfway to the next note, and a negative value means the tone is flat. The mapping is closed-form, not a lookup table of recorded samples. Continuous MIDI equals sixty-nine plus twelve times the base-two logarithm of frequency divided by the A4 reference; the nearest integer MIDI number is the snapped semitone; cents equal one hundred times the fractional remainder.
Scientific octave follows MIDI divided by twelve, minus one, and the note letter comes from MIDI class modulo twelve using sharps (C, C sharp, D, through B). Concert A at four hundred forty hertz is A4 at zero cents; a slightly sharp four hundred forty-five hertz is still A4, a handful of cents above the reference. There is no network path, no random seed, and no clock.
If you need just-intonation ratios, historical temperaments, or audio-file pitch detection, those are different tools; this page is the deterministic hertz-to-nearest-semitone conversion with a stable cents deviation you can pin in tests and worksheets.
Where a semitone calculator fits in practice, teaching, and software
Performers and instrument makers use a semitone calculator when a strobe tuner, phone FFT, or workshop meter reports raw hertz and they need the closest written pitch plus how many cents to turn a peg, reed, or pipe. Audio engineers map measured spectrum peaks to note names for patch notes, sample-library metadata, and conversations with musicians who think in pitch rather than hertz.
Physics and music-technology teachers introduce the twelve-tone logarithmic scale by letting students type a frequency and immediately see the note, octave, cents, MIDI number, semitone offset from A4, and reconstructed nearest frequency under a chosen concert pitch. App builders call the same contract from scripts to seed deterministic test vectors for tuning interfaces, to normalize user-entered frequencies before showing a note badge, or to satisfy programming challenges that demand a named semitone and a cents deviation rather than a hand-waved guess.
Ear-training projects need an offline source of named pitches so learners can verify that a synthesized tone or whistle matches the intended note within a few cents. Document that cents here are always relative to equal temperament at the chosen A4, not to just intonation or historical temperaments. If you already have two frequencies and only need the interval between them, use a cents-between-frequencies helper; if you start from a note name and want hertz, use a note-frequency helper.
This landing is the search for a semitone calculator that starts from a measured tone in hertz and returns the nearest named pitch plus cents.
What you can do with it
Tuner and workshop checks
Convert a measured hertz reading from a meter or FFT into the nearest note name, octave, and cents so you can tune or document a pitch quickly.
Teaching equal temperament
Show students how log2 frequency ratios map to MIDI, named semitones, and cents under a chosen concert A4 reference.
FAQ
What does the semitone calculator cost?
It is free in your browser on this page.
How is the nearest note chosen from a frequency?
Continuous MIDI is 69 + 12 × log2(frequency / A4). The nearest integer MIDI number is the snapped semitone; the note letter and octave come from that MIDI class, and cents are 100 times the fractional remainder.
What happens if the frequency is zero or negative?
A logarithmic pitch scale is only defined for strictly positive frequencies in hertz.
Are cents measured from A4 or from the nearest note?
Cents in the response are the signed deviation from the nearest equal-temperament note, not the total interval from A4.
Can I use a concert pitch other than 440 Hz?
Yes. Set the A4 reference to the pitch your ensemble tunes to and every note and cents value is worked out from it. If you leave it empty, A4 is 440 Hz.
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/semitone \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"frequency":440}'const res = await fetch("https://api.kit.forhosting.com/hobby/semitone", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"frequency": 440
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/hobby/semitone",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"frequency": 440
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/hobby/semitone", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"frequency":440}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"frequency":440}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/hobby/semitone", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"frequency": 440
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "hobby.semitone",
"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_value | 1000000000000000 |
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
Non-positive frequencies are rejected with invalid_input because a logarithmic pitch scale has no meaning at zero or below.
What a semitone is and how frequency maps onto a named pitch
Non-positive frequencies cannot sit on a logarithmic pitch scale and are rejected with invalid_input rather than a fabricated note name.
How frequency and reference are read, and how results stay reproducible
The required field is frequency, the measured tone in hertz. Numeric strings with an optional leading sign and scientific notation are allowed when they parse as finite decimals; empty strings, hex prefixes, and non-numeric tokens fail with a message that names the field so a bad cell does not become a wrong note label. A provided reference must also be strictly positive so the ratio frequency over A4 stays defined and finite. Positive cents mean sharp of the named note; negative cents mean flat. Aliases f, freq, hz, and frequency_hz are accepted so spreadsheets, query strings, and typed forms can reuse the same contract without renaming columns. Optional reference sets the A4 concert pitch in hertz and defaults to four hundred forty when omitted; aliases a4, ref, reference_pitch, and concert_pitch are accepted for the same value. Frequency must be strictly positive: zero and negative hertz values are invalid_input because the logarithm of a non-positive ratio is not a real pitch. The response echoes frequency and reference, then returns note, octave, a full_name such as A4, signed cents deviation from that nearest pitch, the integer midi number, the integer semitones_from_a4 offset from concert A, the reconstructed nearest_frequency in hertz, and a short formula string. Pair the free page with the priced API when you need the identical JSON in continuous integration. Each successful API lookup costs $0.002; failed validation is not charged.
Where a semitone calculator fits in practice, teaching, and software
On this page the work runs entirely in your browser; through the API each successful lookup costs $0.002, invalid input is not billed, and nothing is stored after the response returns.
Integration use cases
Deterministic test fixtures
Generate reproducible note, cents, midi, and nearest_frequency values for unit tests, property checks, and CI assertions in audio tools.
Technical questions
Can I change the concert pitch from A440?
Yes. Set reference (aliases a4, ref, reference_pitch, concert_pitch) to the A4 frequency you use, such as 432 or 442. It must be a positive finite number.