Garden Voila

Garden Sun and Shade Calculator

Enter your ZIP code and describe what stands next to your bed to see its hours of direct sun, month by month.

How many hours of direct sun does your garden bed really get? Most gardeners guess, and the guess is often wrong, because a fence, a house wall or a tree can steal hours of light in one season and none in another. This garden sun and shade calculator works it out. Enter your ZIP code, describe what stands next to your bed, and it shows the hours of direct sun for every month of the year, where the sun travels across your sky and which crops fit the light you have.

It uses the same idea as a sun-path chart used by surveyors and solar installers, but it is built for a vegetable bed. It works from the latitude of your ZIP code and a bit of geometry, so it needs no sign-up and sends nothing anywhere. It works in feet, like the other tools on the site.

How to use the garden sun and shade calculator

  1. Enter your ZIP code and press the button. The calculator looks up the latitude of your ZIP code, which is what decides how high the sun climbs in each season.
  2. Pick a month. The result is for the middle of that month. Summer vegetables care most about May to August, while spring and fall crops care about March, April, September and October.
  3. Set the height of your plants. Sun is measured at that height above the soil. Two feet suits most beds, and you can raise it for tall crops like tomatoes or corn.
  4. Describe obstacle 1. Choose fence, wall or building, an evergreen, or a leafy tree. Then enter its height, how far it stands from your bed, the direction it lies from the bed and its width.
  5. Add a second obstacle if you need one, such as a tree beyond the fence.
  6. Read the results. You get the hours of direct sun, a tip on how far to move the bed, a chart of the sun’s path, a bar for each month, the shadow length at noon and the crops that suit the light.

Every number updates as you change the boxes, so you can try moving the bed, shortening a fence or removing a tree and watch what happens.

What the results mean

Gardening guides sort light into a few groups by the hours of direct sun a spot receives. The exact cut-offs vary a little between sources, but these ranges are widely used and are the ones the calculator shows:

Direct sun per dayCalledSuits
6 hours or moreFull sunTomatoes, peppers, squash, cucumbers, beans and most vegetables
4 to 6 hoursPart sunLeafy greens, many root crops, herbs, peas
2 to 4 hoursPart shadeThe most shade-tolerant greens and herbs, with slower growth
Under 2 hoursShadeShade-loving ornamentals such as hostas and ferns

Direct sun means sun that reaches the bed without passing through a building or thick foliage. A bright but shaded corner can feel light and cheerful and still give a vegetable very little energy to grow with. That is why counting hours matters more than how a spot looks at one moment of the day.

How the calculator works

The sun’s height and direction at any moment depend on three things: your latitude, the date and the time of day. For each of the 288 five-minute steps in a day, the calculator finds where the sun is, then asks whether one of your obstacles stands in the way. The sun’s height above the horizon comes from a standard formula:

sin(sun height) = sin(latitude) × sin(declination) + cos(latitude) × cos(declination) × cos(hour angle)

The declination is how far north or south of the equator the sun sits on that date. It swings between about 23.4 degrees north on June 21 and 23.4 degrees south on December 21. The hour angle is how far the sun is from its highest point in the day, 15 degrees for every hour. The direction of the sun, from north, comes from the same angles.

An obstacle blocks the sun when two things are true at once. The sun has to be in the direction of the obstacle, within the angle it covers from where your bed is. And the sun has to be lower than the top edge of the obstacle as seen from the bed, which depends on its height above your plants and how far away it stands.

Top edge of obstacle (degrees) = arctan( (height − plant height) × cos(angle off center) ÷ distance )

Solid things such as fences, walls and buildings block all of the sun that hits them. Trees let some light through: the calculator lets about 10 percent through an evergreen, and about 35 percent through a leafy tree in summer, rising to about 85 percent when a deciduous tree is bare in winter. It adds up the sun that gets through, and counts only the time when the sun is more than 5 degrees above the horizon, since light that low is weak and passes through a lot of haze.

Worked example: a 6 foot fence south of a bed

A very common situation is a bed placed along a fence. Take a 6 foot solid fence, 30 feet long, that lies due south of the bed and stands 5 feet away, with plants measured at 2 feet. At latitude 40.7 degrees north, about the latitude of New York City, the results change a lot through the year:

MonthOpen sky (no fence)With the fence
January8.3 hours0.0 hours
February9.5 hours0.0 hours
March10.8 hours10.8 hours
April12.2 hours12.2 hours
May13.3 hours13.3 hours
June13.8 hours13.8 hours
July13.7 hours13.7 hours
August12.8 hours12.8 hours
September11.5 hours11.5 hours
October10.2 hours6.0 hours
November8.8 hours0.0 hours
December8.0 hours0.0 hours

From March to September the fence takes nothing, because the sun is high enough to clear it. From November to February the same fence blocks the whole day, since the winter sun never climbs above the top of the fence as seen from the bed. October is the turning point, where the bed falls from 10 hours to 6. This pattern explains why a bed that thrives all summer can be useless for winter greens and early spring crops in the same spot.

Moving the bed helps. With the fence 10 feet away instead of 5, the same bed gets 4.7 hours in December, up from none. To reach a full 6 hours in December the calculator says to move it about 12 feet from the fence. For an early spring crop, 4 feet is enough to get 6 hours in March.

Worked example: a house wall

A two-story house is a much bigger obstacle. Try a wall 25 feet tall and 40 feet wide, 15 feet south of the bed, at the same latitude. In June the bed still gets 13.8 hours, the same as open sky, because the midsummer sun climbs above the roofline. In December it gets none at all. A north-facing bed against the south side of a house is therefore a fine place for summer vegetables and a poor one for winter crops, and that is true of every house at this latitude.

Worked example: a leafy tree

Trees are gentler than walls. A leafy tree 30 feet tall with a crown 20 feet wide, standing 12 feet to the southwest of the bed, takes the June total from 13.8 hours down to 12.4. The leaves let a good share of the light through. In January, when the tree is bare, the bed gets 7.8 hours against 8.3 hours of open sky. This is why a deciduous tree is often a better neighbor for a vegetable bed than an evergreen of the same size, which blocks most of the light all year.

Why shadows are so long in winter

The sun climbs much higher in summer than in winter, and that decides how long a shadow is. At 40.7 degrees north, the sun at solar noon reaches about 25.9 degrees above the horizon on December 21, 48.8 degrees at the spring equinox and 72.8 degrees on June 21. A shadow is as long as the height of the object divided by the tangent of that angle.

Shadow length = height ÷ tan(sun height)

For the 6 foot fence, that gives a shadow of about 12.4 feet at noon in December, 5.2 feet at the equinox and just 1.9 feet in June. So at midday a fence casts a shadow twice its height in December and less than a third of its height in June. Morning and evening shadows are much longer than the noon ones. The calculator shows the noon lengths for each obstacle you enter, as a quick guide to where a bed can go.

How latitude changes the answer

The farther north you live, the bigger the gap between summer and winter. With open sky and no obstacles, the usable hours of direct sun in the middle of June and December are:

LatitudeExample areaJuneDecember
29.8 degrees northHouston, Texas13.0 hours9.2 hours
40.7 degrees northNew York, New York13.8 hours8.0 hours
47.6 degrees northSeattle, Washington14.5 hours7.0 hours

These figures count only the time the sun is more than 5 degrees above the horizon. They are the most sun an unobstructed spot can get, and real life is lower. Cloud cover is not counted, since the calculator estimates direct sun on a clear day. The point of the table is the pattern: southern gardeners have a gentler winter, and northern gardeners get long summer days but a very low winter sun that even a short fence can block.

How many hours of sun do crops need?

The numbers below are the usual guidance from gardening and extension sources, and individual varieties differ, so check your seed packet. As a rule of thumb:

  • Fruiting crops such as tomatoes, peppers, eggplant, squash, cucumbers and beans want at least 6 hours, and 8 is better. With less, plants usually grow but set fewer fruit.
  • Leafy greens such as lettuce, spinach, kale and chard cope with 4 to 6 hours, and some tolerate less. In hot summers, a little afternoon shade can even keep them from bolting.
  • Root crops such as carrots, beets and radishes usually manage with 4 to 6 hours, though they grow more slowly with less light.
  • Herbs vary. Mediterranean herbs such as rosemary, thyme and oregano like full sun, while mint, parsley and chives are happier with part shade.

Our plant database lists each crop as full sun or full sun to part shade, and the sunlight requirement finder helps you match a crop to the light you measured. The calculator also lists crops that fit the hours it finds.

How to measure sun by hand

A calculator gives an estimate, and it is worth checking against real life, especially if your yard is hemmed in by buildings or hills. Here is a simple way to measure the sun on the ground:

  1. Pick a clear day in the month that matters to you.
  2. At the start of each hour from sunrise to sunset, look at the bed and note whether direct sun is reaching it.
  3. Take a photo from the same spot each time, so you can compare the patterns later.
  4. Count the hours of direct sun. Partial shade from a leafy tree counts as about half an hour for every hour.
  5. Repeat in a second season, since the pattern changes a lot between spring and summer.

If your measured hours are far from the calculator’s, the most likely cause is an obstacle you did not enter, such as a neighbor’s tree or a building across the street.

Choosing where to put your beds

The best bed placement is a trade-off between the sun you have and the crops you want to grow. Some practical rules follow from the examples above:

  • Plan for the season you will use the bed. A bed for tomatoes only needs good sun from May to September. A bed for winter greens or early spring peas needs sun in the months when the sun is lowest.
  • Keep beds clear of tall obstacles on the south side. In the northern half of the country the south is where the sun is, so a fence or wall there casts a shadow over the bed. A north-side obstacle usually costs much less.
  • Put tall crops on the north side of a bed. Tomatoes, corn and pole beans then shade their neighbors less.
  • Run rows north to south when you can, so each row gets sun on both sides during the day.
  • Use the shadow table. The noon shadow length for the winter and the equinox rows tells you roughly how far to keep a bed from a fence or wall.

Once you know where the sunny spots are, the garden planner, the raised bed planner and the vegetable garden planner help you lay the beds out, and the plant spacing calculator counts how many plants fit.

Ways to get more sun on a bed

  • Move the bed. The tip under the result tells you how far, and it is the cheapest fix.
  • Prune. Thin the crown of a tree or lift its lower branches to open a gap for low-angle sun. Remove only what you need, and check local advice for large trees.
  • Raise the bed. A taller bed lifts the plants higher, and the calculator’s plant height box shows the effect. See our raised garden bed ideas for designs.
  • Use containers on wheels. Pots can follow the sun through the year. Our guide to container vegetable gardening covers pots and sizes, and the container garden planner checks each pot.
  • Add a reflective surface. A white wall or fence on the sunny side of a bed bounces extra light onto the plants.
  • Choose crops to match. Part-shade spots grow lettuce, kale and herbs well. If the shade is deep, our guide to shade garden plants has flowers and foliage that thrive there.

Seasons, trees and changing shade

Shade is not fixed. A young tree grows taller each year, a neighbor may build or remove something and a deciduous tree changes with the seasons. Leafy trees give heavy shade from late spring through early fall and little in winter, which suits crops that grow in the cool months. Evergreens block more light all year. If your garden is likely to change, run the calculator again every year or two, and note the date you measured.

Frost also shapes what you can grow when. Our frost dates by ZIP code tool shows when the growing season starts and ends where you live, and the two together give a good picture of when a bed is both sunny and warm enough.

What the calculator does not know

The calculator is a planning tool, and it is honest about its limits. It treats each obstacle as a simple flat shape of the width you give, so an irregular tree or a building with a pitched roof is only roughly matched. It does not know about hills, a neighbor’s buildings or trees you did not enter. It assumes clear skies, so cloudy summers will give less sun than shown. It uses the latitude of the center of your ZIP code area, which is close enough for sun but can differ a little from your exact yard. For the real answer, combine the estimate with a day of watching the spot.

Frequently asked questions

How many hours of sun is full sun?

Most gardening guides call 6 or more hours of direct sun full sun. Part sun is usually 4 to 6 hours, part shade 2 to 4 and shade under 2, although sources differ a little.

Does the calculator count cloudy days?

No. It estimates direct sun on a clear day. Cloudy weather reduces the sun your plants get, so a very cloudy region will receive less than the result shows.

Which side of the house gets the most sun?

In the United States, the south side gets the most sun through the year, the west side gets hot afternoon sun, the east side gets gentler morning sun and the north side gets the least direct sun.

Why does a short fence block so much winter sun?

The winter sun stays low in the sky. At 40.7 degrees north it climbs to only about 26 degrees at noon in December, so even a 6 foot fence a few feet away can shade a low bed for the whole day.

How far from a fence should I put a vegetable bed?

It depends on the season you need the sun. For summer crops a few feet is often enough, while for winter greens it can take 10 feet or more for a 6 foot fence at 40 degrees north. Enter your own numbers and the calculator gives the distance for the month you choose.

Do deciduous trees block less sun than evergreens?

Yes. A leafy tree lets some light through in summer and much more in winter when it is bare, while an evergreen blocks most light all year round.

Can I grow vegetables with 4 hours of sun?

Yes, but choose carefully. Leafy greens, many root crops and herbs usually cope with 4 to 6 hours, while tomatoes, peppers and squash need more and will give a smaller harvest with less.