Environment calculators

Sunset Calculator

Updated Aug 28, 2026 By Jehan Wadia
Rate Formulas
1. Location
Location input mode
    Type at least 1 character. Suggestions show city, country and UTC offset.
    New York, United States
    2. Date
    3. Calculation Mode
    Choose output type
    4. Time & Display Settings
    Auto-detected from your device on load; change any time.
    Advanced: editing this value overrides the time-zone dropdown above (e.g. −5, 5.5, 5.75).
    Daylight Saving Time
    Independent of the UTC offset field above.
    Time format
    Seconds

    Location & Date Used
    Dusk Phases
    Golden Hour & Blue Hour
    Day Timeline (local 24-hour span)
      Additional Astronomical Detail
      Solar Altitude Through the Day
      Step-by-Step Solution

      Introduction

      This sunset calculator tells you what time the sun will set at any spot on Earth. Pick a city, type your own latitude and longitude, or let your browser find you. Then choose a date. The tool does the math and shows you the sunset time in your local time zone and in UTC.

      You get more than just one time. The calculator also shows the sunset azimuth (the compass direction where the sun goes down), how long the day lasts, and the times for civil, nautical, and astronomical dusk. Photographers can see golden hour and blue hour times, too. A colored timeline and a chart show how the sun's height changes from midnight to midnight. If you also want morning times, the Sunrise Sunset Calculator covers both ends of the day.

      Need more than one day? Switch to Date Range mode to get a table of sunset times for a week, a month, or a whole year. You can export that table as a CSV file. To count the days between two dates in that span, try the Date Duration Calculator.

      Live far north or far south? The tool handles that. If the sun never sets (midnight sun) or never rises (polar night), it says so and tells you the closest date with a real sunset.

      Every answer comes with a step-by-step solution. You can see the Julian day, the solar declination, the equation of time, and the hour angle formula used to find the sunset. It is a good way to check your work or learn how sunset math really works. The Julian Date Calculator and the Trig Calculator are handy if you want to redo any single step by hand.

      How to use our Sunset Calculator

      Enter your location, the date, and your time settings. The calculator shows you the sunset time, the sunset direction, day length, dusk phases, golden hour, blue hour, and a step-by-step solution.

      Location input mode: Pick "City Lookup" to search a city by name, or pick "Manual Coordinates" to type your own latitude and longitude.

      Search for a city: Start typing a city name and click it in the drop-down list. The list shows the country and UTC offset.

      Use My Location: Click this button to let your browser find your spot. You must allow location access.

      Coordinate entry format: Choose "Decimal Degrees" for numbers like 40.7128, or "Degrees / Minutes / Seconds" to type each part on its own. If you need the ground distance between two coordinate pairs, the Lat Long Distance Calculator works from the same numbers.

      Latitude: Type how far north or south you are. North is positive, south is negative. Use the ± N/S button to flip it.

      Longitude: Type how far east or west you are. East is positive, west is negative. Use the ± E/W button to flip it.

      Month, Day, and Year: Pick the date you want the sunset time for. Click "Today" to jump back to today's date. To look ahead, the Days from Today Calculator finds the exact calendar date a set number of days out.

      Calculation mode: Choose "Single Day" for one sunset time, or "Date Range" to get a table of sunset times over many days.

      Number of days / months and range unit: In range mode, type how long the range is and pick days or months. Click "Full Year" to see a whole year from January 1.

      Time zone: Pick your zone from the list. It is set from your device when the page loads. Comparing two places? The Time Zone Difference Calculator shows the gap between them.

      UTC offset override: Type an offset in hours if you want to set it yourself. This beats the time zone list. Use values like −5, 5.5, or 5.75. The Time Zone Calculator helps you confirm the right offset.

      Daylight Saving Time: Turn this switch on to add one hour to all local times.

      Time format: Choose 12-hour with AM/PM or 24-hour clock times. For military time conversions, see the Military Time Calculator.

      Seconds: Tick this box to show seconds in every time.

      Date format: Pick how dates look, such as MM/DD/YYYY, DD/MM/YYYY, or YYYY-MM-DD.

      Optional columns: In range mode, tick the boxes to add nautical dusk, astronomical dusk, or azimuth to the table. Click "Export as CSV" to save it.

      Click Calculate to see your results, or Reset to start over.

      What Is Sunset?

      Sunset is the moment the top edge of the Sun drops below the horizon. After that, the sky stays bright for a while because air high above you still catches sunlight. That glow is called twilight or dusk.

      Why Sunset Time Changes

      Sunset time is not the same everywhere or every day. Three things move it:

      • Your latitude: How far north or south you are. Places near the poles have huge swings between summer and winter.
      • Your longitude: How far east or west you are inside your time zone. Being on the west edge of a zone means a later clock sunset.
      • The date: Earth is tilted about 23.4°, so the Sun sits higher or lower in the sky as the year goes on. Sunsets get later in spring and earlier in fall.

      Twilight Steps After Sunset

      Astronomers split dusk into three stages, based on how far the Sun has sunk below the horizon:

      • Civil dusk (6° below): Still light enough to read outside or drive without headlights.
      • Nautical dusk (12° below): The horizon at sea is just barely visible. Bright stars show up.
      • Astronomical dusk (18° below): Full dark. The last faint glow is gone and dim stars appear. If you are planning a night of stargazing, check the Moon Phase Calculator too, since a bright moon washes out faint objects.

      Golden Hour and Blue Hour

      Photographers love the time near sunset. Golden hour starts when the Sun is about 6° above the horizon and ends at sunset. Light is warm, soft, and orange. Blue hour comes after that, when the Sun is roughly 4° to 8° below the horizon, and the sky turns deep blue. To work out how long a shoot window lasts, the Time Duration Calculator does the subtraction for you.

      Sunset Azimuth

      Azimuth is the compass direction where the Sun goes down, measured in degrees from north. The Sun only sets due west (270°) near the spring and fall equinoxes. In summer it sets more toward the northwest in the Northern Hemisphere, and in winter more toward the southwest. If you are aiming panels or windows, pair this with the Sun Angle Calculator and the Solar Panel Calculator. The Angle Calculator helps with any extra bearing math.

      Midnight Sun and Polar Night

      Above the Arctic Circle (about 66.5° N) and below the Antarctic Circle, there are days with no sunset at all. In summer the Sun circles the sky all day. This is the midnight sun. In winter the Sun never rises, which is polar night. Long stretches of daylight or darkness can throw off your rest, so the Sleep Calculator may help you set bedtimes on those trips.

      Why Sunset Is a Bit Later Than You Expect

      Two effects push sunset later. First, Earth's air bends sunlight, so the Sun looks about half a degree higher than it really is. Second, sunset is timed to the Sun's upper edge, not its center. Together, these add a few minutes. That is why sunset is defined at an altitude of −0.833°, not 0°. How strongly the air bends light depends on temperature and pressure, which the Air Density Calculator explores in more detail.

      Solar Noon and the Equation of Time

      Solar noon is when the Sun is highest in your sky. It rarely lands at 12:00 on the clock. The equation of time explains the gap. It comes from Earth's tilted axis and its oval orbit, and it can shift sundial time up to about 16 minutes ahead of or behind clock time during the year.

      Good Uses for Sunset Times

      Knowing sunset helps with planning photo shoots, hikes, stargazing, sports games, travel, fishing, prayer times, and safe driving. Day length numbers also help gardeners and farmers track the growing season, alongside tools like the Plant Spacing Calculator and the Grass Seed Calculator. Travelers can match sunset against arrival times from the Flight Time Calculator or plan an evening drive with the Drive Time Calculator. For outdoor comfort near dusk, the Dew Point Calculator and the Wind Chill Calculator round out the picture.


      Formulas used

      Julian Day at 00:00 UT
      JD_0 = \lfloor 365.25(Y+4716)\rfloor + \lfloor 30.6001(M+1)\rfloor + D + B - 1524.5,\quad B = 2 - \lfloor Y/100 \rfloor + \lfloor \lfloor Y/100 \rfloor /4 \rfloor
      Julian centuries since J2000.0
      T = \frac{JD - 2451545.0}{36525}
      Solar declination
      \delta = \arcsin\left(\sin\varepsilon \cdot \sin\lambda\right)
      Equation of time (minutes)
      E = 4\left[ y\sin(2L_0) - 2e\sin M + 4ey\sin M\cos(2L_0) - \tfrac{1}{2}y^2\sin(4L_0) - \tfrac{5}{4}e^2\sin(2M) \right],\quad y = \tan^2\!\left(\frac{\varepsilon}{2}\right)
      Sunset hour angle (refraction-corrected altitude h_0 = -0.833 degrees)
      \cos H = \frac{\sin h_0 - \sin\phi \cdot \sin\delta}{\cos\phi \cdot \cos\delta}, \quad H = \arccos(\cos H)
      Sunset time in UTC (minutes past midnight)
      t_{UTC} = 720 + 4H - 4\lambda_{lon} - E
      Local time conversion (with UTC offset and DST)
      t_{local} = t_{UTC} + 60 \cdot (\text{offset}_{h} + \text{DST})
      Sunset azimuth
      A = \operatorname{atan2}\!\left(\sin H,\; \cos H \sin\phi - \tan\delta \cos\phi\right) + 180^\circ

      Frequently asked questions

      How accurate is this sunset calculator?

      Sunset times are usually within about one minute of official times. The math uses standard NOAA solar formulas. Small gaps can come from your local elevation, hills, tall buildings, or odd weather that bends light more than normal.

      Why does the calculator show a different time than my weather app?

      Most gaps come from three things:

      • Your UTC offset or DST switch does not match the real local rule for that date.
      • Your coordinates point to a slightly different spot than the app uses.
      • The app may round to the nearest minute in a different way.

      Check the DST switch first. It is the most common cause.

      Does the tool turn Daylight Saving Time on by itself?

      No. The DST switch is manual. It is set from your device when the page loads, but it does not change for the date you pick. If you look up a summer date in a DST region, turn the switch on yourself. It adds one hour to every local time shown.

      Does elevation change the sunset time?

      Yes, but this tool does not include it. Standing higher lets you see farther over the horizon, so sunset comes later. Roughly, 100 meters up adds about 2 minutes. On a tall mountain the gap can be 5 minutes or more.

      What does the −0.833° number in the steps mean?

      It is the Sun's official altitude at sunset. It is below zero for two reasons: air bends sunlight up by about 0.567°, and sunset is timed to the Sun's top edge, not its center, which adds about 0.267°.

      Why do I get a No sunset or Midnight Sun message?

      You picked a spot near a pole on a date when the Sun stays up all day or stays down all day. The math has no answer because the cosine of the hour angle falls outside −1 to 1. The tool then shows you the last sunset before that date and the next one after it.

      What is the largest date range I can build?

      750 days. If you enter more, the tool caps the table at 750 rows and tells you. A full year is easy with the Full Year button, which sets January 1 and the right number of days for leap years.

      How do I open the CSV file after I export it?

      Open it in Excel, Google Sheets, Numbers, or any spreadsheet app. The file name includes your location and the start and end dates, so you can save many ranges without mixing them up.

      Can I get sunrise times here too?

      This tool focuses on sunset, but it uses sunrise inside the math to give you day length. For full sunrise times, use the Sunrise Sunset Calculator linked above.

      What time zone should I pick for a place I am not in?

      Pick the city in City Lookup mode. The tool fills in the matching time zone and UTC offset for you. If the zone is not listed, switch to Manual Coordinates and type the UTC offset by hand.

      Why can I type half and quarter hour offsets?

      Some places do not use whole-hour offsets. India is UTC+5:30, Nepal is UTC+5:45, and Chatham Islands is UTC+12:45. Type 5.5, 5.75, or 12.75 in the offset box for those.

      What is the difference between golden hour and blue hour here?

      Golden hour runs from when the Sun is 6° above the horizon down to sunset. Blue hour runs from civil dusk (6° below) to about 8° below. Golden hour light is warm and orange. Blue hour light is cool and even.

      Is golden hour always a full hour?

      No. Near the equator the Sun drops fast, so golden hour can last only 20 to 30 minutes. Near the poles it can stretch for hours. The tool shows the real start and end times for your spot and date.

      How do I read the sunset azimuth?

      Azimuth is degrees clockwise from north. 270° is due west, 315° is northwest, 225° is southwest. The tool also gives a compass word like WNW so you can point a camera or check a window view.

      Why is the timeline bar sometimes all one color?

      Near the poles in summer the whole 24 hours can be daylight. In deep winter it can be all night or all twilight. The legend below the bar lists only the phases that happen on your date.

      Does this work for dates far in the past or future?

      Yes, from year 1000 to 3000. Accuracy is best within a few hundred years of today. Very old or very distant dates drift a bit because Earth's rotation speed changes slowly.

      Do I have to click Calculate every time?

      No. The tool recalculates when you change a city, date, mode, or time setting. The Calculate button is there if you want to force a refresh after typing.

      Why does the city list only show some cities?

      The list holds about 175 major cities. If yours is missing, pick the closest one, or switch to Manual Coordinates and type your exact latitude and longitude for a better answer.

      What is a Julian Day and why is it in the steps?

      It is a running count of days used by astronomers. It gives every date one plain number, which makes the solar math simple. The tool shows the Julian Day for midnight UT on your date.

      Can I use this to set solar panels or plan a garden?

      Yes. The azimuth tells you where the Sun sets, which helps with panel and window placement. Day length numbers help gardeners track sunlight hours through the growing season.