Apparent brightness calculator
Double the distance to a star and its apparent brightness falls to a quarter; triple it and it drops to a ninth. Enter the luminosity and distance to get the flux reaching the observer, step by step. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Intrinsic luminosity
- 382,600,000,000,000,000,000,000,000
- Distance
- 149,600,000,000
- L
- 382,600,000,000,000,000,000,000,000
- D
- 149,600,000,000
- D squared
- 22,380,160,000,000,000,000,000
- Four pi d2
- 281,237,384,968,656,570,000,000
An apparent brightness calculator turns a star's intrinsic luminosity and its distance into the flux an observer would measure under the inverse-square law. Enter luminosity L (radiated power) and distance d; the tool returns b equals L over four pi d squared, plus d squared, the four-pi-d-squared denominator, a readable equation string, and step-by-step substitution so homework checks and pipeline asserts stay deterministic. Astronomy labs, photometry primers, coding kata expected values, and quick solar-constant style checks all need that same flux number without opening a full astrophysics suite.
What apparent brightness means under the inverse-square law
Apparent brightness is the radiative flux received at a given distance from an isotropic source: energy per unit time per unit area. If a star radiates total power L (its luminosity) uniformly into space, that power is spread over a sphere of surface area four pi d squared at distance d from the centre. Dividing gives the classic inverse-square formula b equals L divided by four pi d squared.
Double the distance and the flux falls by a factor of four; triple it and flux falls by nine. This is not the same as apparent magnitude, which is a logarithmic scale tied to a zero-point and often includes filter bandpasses; this tool stays in linear flux units so you can verify textbook problems that ask for brightness or flux in watts per square metre or any consistent power-over-area unit.
Luminosity must be positive because a non-emitting source has zero or undefined flux of interest for this law, and distance must be strictly positive because d equals zero collapses the sphere to a point and the formula is undefined. Teachers and automated graders care about that zero-distance rejection as much as the happy path: a student who plugs d equals zero into inverse-square arithmetic has left the domain of the model, and a silent Infinity would hide the mistake.
The check path recomputes four pi d squared with the same fixed rounding used for published fields, so a successful response always ships with steps you can assert in tests or worksheets.
Practical tips, limits, and related searches
Keep luminosity and distance inside the published absolute range so d squared and four pi d squared cannot overflow into a non-finite flux that the solver must reject. 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. Units are your responsibility: if L is in watts and d in metres, b is in watts per square metre; if you use solar luminosities and astronomical units, interpret the output as flux in those same units.
Prefer this capability when you already have L and d in linear units and only need flux; if your source data is in magnitudes, convert to luminosity first with the appropriate zero-point.
What you can do with it
Homework checks for inverse-square flux
Students enter luminosity and distance from textbook problems and compare hand-written b and 4πd² against a deterministic result before submitting.
Pre-flight before magnitude or SNR stages
Pipelines compute linear flux from L and d first, then feed b into magnitude conversion or signal-to-noise models only when distance is valid.
FAQ
What is the formula for apparent brightness?
For an isotropic source, apparent brightness (flux) is b = L / (4πd²), where L is luminosity and d is distance. Flux falls with the square of distance.
What happens when distance is zero?
The inverse-square law divides by d², which is undefined at zero.
Is apparent brightness the same as apparent magnitude?
No. Apparent magnitude is a logarithmic scale with a zero-point and often filter-specific. This calculator returns linear flux b = L/(4πd²).
Which units should I use?
Any consistent pair: watts and metres give W/m²; solar luminosities with a matching length unit give flux in those units.
Is the apparent brightness calculator free?
The browser tool is free and runs locally.
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/astro/apparent-brightness \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"luminosity":3.826e+26,"distance":149600000000}'const res = await fetch("https://api.kit.forhosting.com/astro/apparent-brightness", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"luminosity": 3.826e+26,
"distance": 149600000000
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/astro/apparent-brightness",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"luminosity": 3.826e+26,
"distance": 149600000000
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/astro/apparent-brightness", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"luminosity":3.826e+26,"distance":149600000000}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"luminosity":3.826e+26,"distance":149600000000}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/astro/apparent-brightness", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"luminosity": 3.826e+26,
"distance": 149600000000
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "astro.apparent_brightness",
"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 | 1e+36 |
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
When distance is zero the inverse-square formula divides by zero, so the API returns a clear invalid_input error instead of infinity or NaN.
How to call the API and what comes back
Values whose magnitude falls below one times ten to the minus thirty after coercion are treated as non-positive and rejected. Send a JSON body with two required finite numbers: luminosity (aliases L, lum, power, intrinsic_luminosity) and distance (aliases dist, d, range, observer_distance, r). Both must be strictly positive and stay within the published absolute limit of one times ten to the thirty-six so intermediate products remain finite in IEEE double precision on the Worker and in the browser. On success the response echoes rounded luminosity and distance, sets d_squared and four_pi_d2 to the intermediate sphere area factors, apparent_brightness, brightness, flux, and b to the same rounded flux value, formula to the string b equals L over four pi d squared, equation to a human-readable substitution line, units to a short power-length-flux reminder, message to a one-sentence summary, and steps to an ordered array of calculation lines. Failed validation—missing fields, non-finite numbers, values outside absolute limits, non-positive luminosity, or zero or negative distance—returns invalid_input and is never charged. Pricing is a flat $0.002 per successful request with unit item and zero marginal unit price.
Practical tips, limits, and related searches
When teaching, pair examples: the Sun near one AU with L about three point eight two six times ten to the twenty-six watts and d about one point four nine six times ten to the eleven metres yields a solar-constant scale flux; a source twice as far at the same L yields one quarter the brightness; and d equals zero demonstrates the hard invalid_input path. This landing targets people searching for an apparent brightness calculator, inverse-square law flux, or luminosity and distance brightness online; it is not an apparent-magnitude converter, not an extinction or bolometric-correction tool, and not a distance-modulus calculator. Failed tasks that return invalid_input do not consume prepaid balance, which keeps exploratory scripts cheap when learners deliberately set distance to zero. Round-trip checks are easy: recompute L divided by four times pi times d squared by hand and confirm it equals the published apparent_brightness within the same twelve-decimal rounding.
Integration use cases
Unit tests for photometry helper libraries
Generate known-good flux cases plus deliberate zero-distance rejections for coding kata expected values and CI golden fixtures.