Whether you’re preparing for your first garden, planning next year’s plantings after a successful harvest or looking to install a lawn, your first step should be conducting a soil test.

“Soil is one of the basic elements for plant growth,” says Pamela J. Bennett, a professor and the State Master Gardener Program Director for the OSU Extension in Clark County, Ohio. “If we don’t have good soil, plants aren’t going to grow as well.”

Farmers, who depend on cultivating the land for their livelihood, always do a soil test before planting, but it’s a critical step for home gardeners as well, to avoid wasting time, money and resources. Healthy soil equals thriving plants that will be more resistant to pests and diseases.

“A soil test is important so you know what to add to your soil to make your plants grow successfully, whether you’re a farmer, gardener or landscaper,” says Jason Reeves, a research associate at the UT Gardens at the University of Tennessee. A standard test checks for soil pH, organic matter and minerals, including calcium, phosphorus, potassium and magnesium.

“I had someone this week that I was able to tell: ‘You don’t need any limestone. Your pH is just where it should be,’” says Stephanie Murphy, the director of the soil testing laboratory at Rutgers.

Unnecessary fertilizers and other treatments can have negative effects on

both your garden and the environment. Nutrient pollution increases when there is “too much of a nutrient in the soil that can risk polluting our waterways, whether it’s through leaching to the groundwater, runoff, or erosion carrying nutrients and applications, like pesticides,” Murphy says, “so we never want to exceed what’s optimum.”

Here’s what to know about testing your soil:

What you’re testing for

A typical test will look at organic matter, nutrient levels and the soil’s pH. Tests do not usually measure nitrogen. A soil pH that is too high (basic) or too low (acidic) means nutrients aren’t available to the plants, even if they are in the soil, says Shannon Alford, the director of the Agricultural Service and Fertilizer laboratories at Clemson University.

The desired pH depends on what you’re growing and the type of soil. “Most plants grow well in a neutral pH of 6.0-7.0,” Alford says. Some plants, such as blueberries, azaleas and camellias, prefer more acidic soil.

Most soil tests don’t look for contaminants, such as lead, but some places, such as the lab at Rutgers, offer it as an additional service. This test isn’t critical if you’re growing trees or shrubs, but if you’re planting fruits and vegetables, you want to know if there is lead in the soil, says Bennett. For detailed contaminant testing, including heavy metals such as arsenic, cadmium or mercury, Murphy recommends going to a certified environmental testing laboratory.

Where to get testing

Many state university extension offices or cooperative extension programs offer soil testing, with prices typically between $10 and $30. “It’s a very small investment for a big return,” Reeves says. To find a lab near you, search online for your state and soil testing.

Although DIY kits are easy to find at garden centers or online, experts say they aren’t necessarily less expensive than sending it to a lab, and the results aren’t as reliable. “The accuracy of the lab and the recommendations are going to be tailored to your area and what you’re growing,” Alford says.

How to gather your sample

Tests come with detailed instructions. Typically, a lab needs about two cups to perform the test. A sample needs to be reflective of the whole area where you plan to grow, at the root level, which varies for a vegetable garden, shrubs, flowers, trees or a lawn.

“We recommend about 15 to 20 subsamples to 6-inch depth, so you don’t want to rely on just one spot in that area,” Murphy says. “Get an average for that whole area [and] mix them together to create a composite sample. That’s what you send to us.”

If you’re growing trees, Bennett says, you’ll want to go as deep as 12 inches; for a lawn, a soil sample 4 inches down is ideal. Once you have collected samples where you intend to garden, you’ll mix them together and send the composite to the lab.

When — and how often — to test

Alford recommends annual testing at the end of the growing season before fertilizer or any nutrients are added. That timing also helps you avoid the spring rush. Results typically take one to three weeks, but may take longer in the busy season.

That said, tests can be done any time of year as long as the soil isn’t wet or frozen. Getting a sample of frozen soil is difficult, and wet soil is heavier to send and the moisture could deteriorate the bag or box during shipping and alter the soil, Alford says.

What the lab does with a soil sample

Samples are dried in a soil-drying oven at a temperature of 122 degrees Fahrenheit. Technicians mix the soil and break down any large particles. “Different-sized pieces of your soil could skew results,” Alford says.

Then several sample portions are measured for nutrient content, pH and organic matter. Scientists review the data before creating and sending a report specifying whether you need to amend your soil, and if so, with what. Most labs are happy to answer follow-up questions if you have them.

Lauren David writes about gardening and sustainability.