ForHosting KIT · Science

Solar declination by day of year

Type a day of the year and see how far north or south of the equator the Sun stands: day 172, near 21 June, gives 23.45°, using a smooth seasonal model. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon
If you enter
Day
172
You get
Declination deg
23.45
Obliquity deg
23.45

Solar declination is the angular distance of the Sun north or south of the celestial equator—the quantity that drives seasonal day length, solar altitude at noon, and simple irradiance models used in architecture, HVAC, and introductory astronomy. Given only the day of the year as an integer from one through three hundred sixty-six, the standard cosine seasonal model returns an approximate declination in degrees without ephemerides, leap-second tables, or network calls: δ equals 23.45 degrees times the cosine of two pi over three hundred sixty-five times day minus one hundred seventy-two. Day one hundred seventy-two sits near the northern summer solstice so the cosine peaks near plus twenty-three point four five degrees; winter days produce negative values of similar magnitude.

What solar declination tells you

Solar declination is how far north or south of the celestial equator the Sun stands, which is also the latitude where it is directly overhead at noon. It is positive while the Sun is north of the equator and negative while it is south, swinging over the year between roughly plus and minus the tilt of Earth's axis. That single angle drives seasonal day length, the height of the noon Sun and simple shading or sunlight estimates in architecture, heating and cooling design and introductory astronomy.

How the seasonal model works and where it falls short

Enter the day of the year, from 1 for 1 January up to 366 in a leap year. The model multiplies a fixed tilt of 23.45° by a cosine that peaks at day 172, close to 21 June, so day 172 returns 23.45° and day 355 is near -23.45°. It is a smooth approximation: a full astronomical reduction would use the Sun's true longitude and further corrections, so use it for sketches and homework rather than precise ephemerides. A common slip is counting days from zero instead of from 1 January.

What solar declination means and which day value to send

Declination of the Sun is the latitude of the subsolar point: positive when the Sun stands north of the equator, negative when south. Over a tropical year it swings between roughly plus and minus the obliquity of the ecliptic, about twenty-three and a half degrees. Full reductions use the true longitude of the Sun, equation of center, and nutation, but engineering and classroom practice often need only a smooth seasonal curve.

The cosine seasonal model fixes the obliquity at twenty-three point four five degrees and places the peak at day one hundred seventy-two, approximating twenty-one June in a non-leap calendar.

Solar design and HVAC sketches

Architects and energy modelers need a quick seasonal δ for rough noon-altitude or shading estimates without wiring an ephemeris stack into early design scripts.

What happens if the day is outside 1–366?

Day of year must be an integer between 1 and 366 inclusive; values such as 0 or 367 are rejected and are not charged.

Is this the true astronomical declination?

No. This is the standard cosine seasonal approximation with fixed obliquity 23.45° and peak at day 172. It is suitable for teaching and rough solar design, not high-precision ephemerides.

Is the solar declination calculator free?

The browser tool runs free on your device.

Why is day 366 allowed if the formula uses 365?

Leap years need an ordinal day 366 for 31 December. The cosine period still uses 365 as in the classic textbook model; accepting 366 avoids rejecting valid leap-year day numbers.

Why does day 355 give a negative declination?

Day 355 falls near the northern winter solstice, when the Sun stands south of the equator. The cosine in the model is close to -1 there, so the result is near -23.45°, the mirror image of day 172.

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.

POSThttps://api.kit.forhosting.com/astro/solar-declination-day

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.

curl -X POST https://api.kit.forhosting.com/astro/solar-declination-day \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"day":172}'
{
  "day": 172
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "astro.solar_declination_day",
  "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.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

This capability evaluates that expression deterministically, rejects days outside one to three hundred sixty-six with a clear invalid input error, and returns structured JSON that homework checkers, solar-design spreadsheets, and lightweight astronomy pipelines can pin in continuous integration.

What solar declination means and which day value to send

Send the required field day as a JSON number or numeric string representing the ordinal day of year: one for the first of January, thirty-two for the first of February in a non-leap year, one hundred seventy-two near the summer solstice, three hundred fifty-five near the winter solstice, and up to three hundred sixty-six when a leap day is present. Aliases day_of_year, doy, n, and N are accepted for the same integer. Non-integers, non-finite values, and days outside one through three hundred sixty-six fail with invalid_input because they are not a valid day-of-year index for this model. Identical inputs always produce identical JSON because the path is pure floating-point arithmetic with no network, no random seed, and no wall clock.

Reading the response fields and checking classic calendar markers

Near day one hundred seventy-two you should see a value very close to plus twenty-three point four five degrees; near day three hundred fifty-five the cosine is near negative one and declination is near minus twenty-three point four five degrees; around day eighty-one and day two hundred sixty-four the model crosses near zero at the equinoxes. On success the response echoes day, then reports declination_deg as the approximate solar declination in degrees under the cosine model. The field obliquity_deg is always twenty-three point four five, the fixed axial tilt used by the formula. The formula field is always the string δ equals 23.45 times cos of 2π over 365 times open parenthesis N minus 172 close parenthesis, and method is always cosine_seasonal so downstream code can branch without sniffing shapes. Missing day, non-integer day, day zero, day three hundred sixty-seven, and non-finite numbers all fail with invalid_input and are not charged after the engine rejects the request. Use declination_deg alone when a dashboard only needs the angle; keep formula, method, and obliquity_deg when documenting the physics step for students or logging which approximation produced a solar-gain sketch. Pair this endpoint with solar altitude or day-length tools when the next question is how high the Sun stands at local noon for a given latitude—remembering that declination is only one input to those formulas.

API usage, pricing, design workflows, and practical limits

Call the free in-browser solar declination by day of year calculator for homework checks, lecture demos, and quick solar-design verification without installing SPICE, NOVAS, or a full ephemeris library. Typical examples include midsummer day one hundred seventy-two for maximum northern declination, midwinter day three hundred fifty-five for the southern extreme, and equinox-neighborhood days for near-zero declination. The model uses three hundred sixty-five in the cosine argument even when day equals three hundred sixty-six—that is the standard textbook simplification and is intentional. Send a JSON body with required integer day between one and three hundred sixty-six inclusive. Use the prepaid API when a tutoring platform, coding-assessment sandbox, curriculum generator, or building-energy pipeline needs a stable contract under KIT balance at $0.002 per successful item; validation failures never consume balance after rejection. Authors shipping SDKs can map declination_deg into tables of seasonal noon altitude or clear-sky irradiance estimates, teaching how a single smooth cosine captures the dominant annual signal before students graduate to higher-order astronomical reductions.

Homework and exam verification

Students and graders compute approximate solar declination from a day of year, compare against textbook solstice and equinox markers, and get a clear invalid_input error when the day falls outside 1–366.

Tutoring and curriculum generators

Lesson builders produce worked cosine-model examples with structured JSON for flashcards, step sheets, and auto-graded drills that teach seasonal astronomy before full orbital mechanics.

How do I calculate solar declination from the day of the year?

Send JSON with day set to an integer from 1 to 366 (for example 172 near the northern summer solstice). The response includes declination_deg from δ=23.45·cos(2π/365·(N−172)).

Read the full KIT documentation →