Apparent magnitude from absolute magnitude and distance calculator
This apparent magnitude calculator converts an object's absolute magnitude and its distance in parsecs into the apparent magnitude an observer would measure, assuming the standard distance-modulus relationship.
Run — free
It adds the distance modulus, five times the base-10 logarithm of distance minus five, to the supplied absolute magnitude. The result is useful for quick astronomy exercises, catalog checks, observing plans, and reproducible software workflows. Distance must be strictly positive because a logarithm is not defined for zero or a negative distance. The calculation is deterministic and does not query catalogs, estimate extinction, or introduce random approximations.
Enter absolute magnitude and distance correctly
Provide the object's absolute magnitude as a finite number and its distance as a positive number of parsecs. Absolute magnitude is the magnitude the object would have if it were placed at the standard distance of ten parsecs, so it is an intrinsic luminosity scale rather than the brightness directly seen from Earth. Negative magnitude values are valid and usually describe very luminous objects; do not remove a minus sign merely because most everyday scales start at zero. The distance field is specifically in parsecs, not light-years, astronomical units, kilometers, or megaparsecs. Convert another distance unit before submitting it. Decimal and scientific-notation values are accepted, which is convenient for catalog data and distant targets. A distance of zero or less produces an input error instead of a misleading number, because the distance-modulus formula contains a logarithm. Also ensure that the distance represents the same object as the supplied absolute magnitude. Once both values are present, the calculator returns the inputs alongside the modulus and apparent magnitude so the calculation can be audited easily.
Understand the distance-modulus calculation
The calculator uses m = M + 5 log10(d) - 5, where m is apparent magnitude, M is absolute magnitude, and d is distance in parsecs. The expression 5 log10(d) - 5 is the distance modulus. At exactly ten parsecs, log10(10) equals one, the modulus is zero, and apparent magnitude equals absolute magnitude. Increasing distance by a factor of ten adds five magnitudes, reflecting the inverse-square reduction in received flux expressed on astronomy's logarithmic magnitude scale. Moving an otherwise identical object closer than ten parsecs makes the modulus negative and the apparent magnitude numerically smaller, meaning brighter. The output includes the separately calculated distance modulus so you can inspect the intermediate value instead of treating the result as a black box. Results are stabilized to a practical number of significant digits for consistent JSON output while retaining much more precision than typical observational inputs justify. No catalog lookup, extinction coefficient, redshift correction, or photometric-band conversion is included; the formula is applied directly to the numbers you submit.
Interpret the result and its limits
A smaller or more negative apparent magnitude indicates a brighter appearance, while a larger positive value indicates a fainter appearance. This numerical direction often surprises new users, so compare magnitudes rather than reading them like ordinary brightness scores. The computed result is an ideal geometric prediction based only on absolute magnitude and distance. Real observations can differ because interstellar dust absorbs and reddens light, atmospheric conditions affect ground-based measurements, objects vary over time, and absolute magnitudes may be defined in different photometric bands. Make sure the absolute and apparent quantities you compare refer to the same band, such as V or G, and add an extinction correction separately when the scientific context requires one. The calculator is well suited to coursework, sanity checks, pipeline transformations, and estimates where the basic distance modulus is the intended model. It should not replace a full astrophysical model for cosmological distances, where luminosity distance, redshift, K-corrections, and the selected cosmology matter. For automated calls, the base request price is $0.002; the browser calculation uses the same deterministic core logic.
What you can do with it
Check an observing estimate
Estimate how bright a target should appear from its cataloged absolute magnitude and distance before planning an observation.
Verify astronomy coursework
Confirm a distance-modulus exercise and inspect the intermediate modulus alongside the final apparent magnitude.
Transform catalog records
Compute a consistent apparent-magnitude estimate for records that already contain absolute magnitude and distance in parsecs.
FAQ
What formula does the calculator use?
It uses m = M + 5 log10(d) - 5, with distance d measured in parsecs.
Why must distance be greater than zero?
The formula takes the base-10 logarithm of distance, which is not defined as a finite real value for zero or negative inputs.
Can absolute magnitude be negative?
Yes. Negative absolute magnitudes are valid and represent intrinsically luminous objects on the astronomical magnitude scale.
Does the result account for interstellar extinction?
No. It applies the geometric distance modulus only; extinction and other observational corrections must be handled separately.
How much does an API calculation cost?
Each API request has a base price of $0.002. The calculation is also available in the browser.
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/astro/apparent-from-absolute \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"absolute_magnitude":4.83,"distance_parsecs":10}'const res = await fetch("https://api.kit.forhosting.com/astro/apparent-from-absolute", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"absolute_magnitude": 4.83,
"distance_parsecs": 10
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/astro/apparent-from-absolute",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"absolute_magnitude": 4.83,
"distance_parsecs": 10
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/astro/apparent-from-absolute", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"absolute_magnitude":4.83,"distance_parsecs":10}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"absolute_magnitude":4.83,"distance_parsecs":10}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/astro/apparent-from-absolute", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"absolute_magnitude": 4.83,
"distance_parsecs": 10
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "astro.apparent_from_absolute",
"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.
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. |