Adjust audio volume in decibels
This audio gain calculator predicts what happens to a measured peak when you raise or lower a signal by a specified number of decibels.
Run — free
Enter the current peak in dBFS and the gain in dB, and it returns the resulting peak, remaining headroom, and a clear clipping flag. It is useful for checking a proposed level change before processing a file, setting a mixer, or building an automated audio workflow. The calculation is deterministic and does not upload, decode, or modify audio.
Read peak level and gain as two different measurements
A digital peak is commonly expressed in dBFS, where 0 dBFS is the maximum representable level and ordinary unclipped peaks appear as negative values. Gain, by contrast, is a relative change expressed in dB. A gain of 3 dB raises the peak by 3 dB, while a gain of -3 dB attenuates it by the same amount. This calculator keeps those roles explicit: current_peak_dbfs describes where the signal starts, and gain_db describes the change you intend to apply. The resulting peak is their arithmetic sum. For example, a peak at -8 dBFS with 5 dB of gain becomes -3 dBFS. No waveform analysis is performed, so the current peak should come from a trusted meter, editor, loudness report, or earlier processing step. The result predicts peak position after ideal gain only. It does not estimate loudness, dynamics, inter-sample peaks, codec overshoot, or changes caused by compression, limiting, equalization, mixing, or sample conversion.
Interpret clipping and headroom at the 0 dBFS boundary
The clipping flag becomes true only when the calculated peak is greater than 0 dBFS. A result exactly equal to 0 dBFS reaches full scale but does not exceed it, so this calculator reports clipping as false and headroom as zero. That distinction makes boundary checks predictable in automation. A positive result, such as 1.5 dBFS, means the proposed gain would push the known peak 1.5 dB beyond full scale; the returned headroom is therefore -1.5 dB. A negative result leaves positive headroom. This is a mathematical warning, not a simulation of a particular audio system. Floating-point formats and some internal processing chains can temporarily represent values above full scale, while integer exports, digital-to-analog paths, codecs, plug-ins, and mastering requirements may behave differently. Engineers often reserve additional safety margin for true peaks or downstream processing. Use the flag to catch an obvious overage, then apply the headroom result and the requirements of the destination format when choosing a safe final gain.
Use the calculation in repeatable audio workflows
The calculator is designed for small, auditable decisions that need the same answer every time. In a batch pipeline, a peak scanner can provide the current dBFS value, after which this capability can evaluate a requested gain before any rendering begins. A user interface can show the predicted peak and disable an unsafe export, or a quality-control job can record the clipping boolean alongside its source measurement. Negative gain works naturally, making the same endpoint useful for attenuation and headroom targets. Both inputs must be finite JSON numbers; numeric-looking strings are rejected so an integration cannot silently concatenate text or accept an ambiguous value. The returned object repeats the two validated inputs, gives the calculated peak, reports clipping, and expresses remaining headroom as the negative of the resulting peak. Because the function uses no network, randomness, clock, audio decoder, or hidden state, identical inputs produce identical JSON results. Remember that it evaluates one supplied peak and one uniform gain adjustment, rather than inspecting an audio file or accounting for later signal processing.
What you can do with it
Preflight a gain change
Check whether a planned boost would carry a measured file peak above 0 dBFS before starting an export.
Set attenuation for safe headroom
Apply a negative gain value and confirm the resulting peak and available headroom for a downstream stage.
Add a clipping guard to a pipeline
Combine a peak scanner with this deterministic calculation to reject unsafe gain settings in batch audio processing.
FAQ
How is the resulting peak calculated?
The gain in dB is added directly to the current peak in dBFS: resulting peak = current peak + gain.
When is clipping flagged?
Clipping is true when the resulting peak is greater than 0 dBFS. A result exactly at 0 dBFS is not flagged as exceeding full scale.
Can I use negative gain?
Yes. A negative gain attenuates the signal and lowers the predicted peak by that many decibels.
Does this inspect or modify my audio file?
No. It performs arithmetic on the peak and gain values you provide; it does not receive, decode, or change audio.
What does an API request cost?
Each API request costs $0.002.
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/audio/volume-adjust-db \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"current_peak_dbfs":-6,"gain_db":4.5}'const res = await fetch("https://api.kit.forhosting.com/audio/volume-adjust-db", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"current_peak_dbfs": -6,
"gain_db": 4.5
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/audio/volume-adjust-db",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"current_peak_dbfs": -6,
"gain_db": 4.5
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/audio/volume-adjust-db", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"current_peak_dbfs":-6,"gain_db":4.5}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"current_peak_dbfs":-6,"gain_db":4.5}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/audio/volume-adjust-db", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"current_peak_dbfs": -6,
"gain_db": 4.5
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "audio.volume_adjust_db",
"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_mb | 200 |
max_minutes | 180 |
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. |