Recycling code #2 (HDPE) and code #5 (PP) are the two plastics University of Maryland Extension names as food-safe; codes #3 (PVC), #6 (polystyrene), and #7 (polycarbonate) raise leaching concerns worth avoiding for anything that will hold soil you eat from. A container’s history can override all of that: a bucket that once held paint or a cleaning chemical does not become food-safe again no matter which code is stamped on the bottom. Once a container clears both checks, best containers for herbs covers sizing and drainage, which are separate decisions from material safety.
What the recycling code on the bottom actually tells you
University of Maryland Extension names recycling code #2 (HDPE) and code #5 (PP) as the food-safe plastics, alongside a food grade or FDA approved label, or the glass-and-fork symbol, wherever one of those is stamped on instead of a resin code. The same source names three codes to avoid for anything that will hold soil you grow food in: #3 (PVC), #6 (polystyrene), and #7, the catch-all category that includes polycarbonate and other bisphenol-A-containing plastics.
| Code | Plastic | Verdict, per University of Maryland Extension | Where you’ll see it |
|---|---|---|---|
| #2 | HDPE | Food-safe | Milk jugs, juice jugs, many food-grade buckets |
| #5 | PP | Food-safe | Yogurt tubs, medicine bottles |
| #3 | PVC | Avoid | Some plumbing pipe, cling film |
| #6 | Polystyrene (PS) | Avoid | Foam cups and trays, some rigid packaging |
| #7 | Polycarbonate and other mixed resins (BPA) | Avoid | Large water jugs, some mixed-plastic items |
A resin code alone doesn’t certify a specific container the way a “food grade” or “FDA approved” label, or the glass-and-fork symbol, does. A manufacturer stamps the number to identify what the plastic is made of, not to promise that particular item was produced to food-contact standards. Codes #2 and #5 are simply the two resins University of Maryland Extension points to as the safer bet when a clearer label isn’t there to check instead.
A container’s history can disqualify it, whatever the code says
The number stamped into a bucket describes what it’s made of, not what has touched the inside of it. University of Maryland Extension states plainly that a bucket which previously held paint or a cleaning chemical is not food-safe again, even if it’s made from #2 HDPE, the resin that would otherwise clear it. Residue that has soaked into the plastic over months or years of storage can migrate back out into damp potting mix as you water a growing season’s worth of vegetables.
University of Kentucky Cooperative Extension states the same rule from the sourcing side: “make sure the buckets are food grade in order to avoid chemical residues from leaching into the soil.” The same guidance notes that some restaurants, bakeries, and grocery stores give away their empty food-grade buckets — the kind that held pickles, frosting, or bulk cooking oil — instead of sending them to a dumpster. That’s the practical version of the rule above: start with a container whose only previous contents were food, and the leaching question mostly disappears before it starts. A quick rinse doesn’t settle the question for a container that fails on material or history, either: the concern is what has already migrated into the plastic or wood over time, not what happens to be sitting on the surface the day you decide to plant.
Wood treated with creosote or pentachlorophenol
Plastic isn’t the only material with a documented risk attached to it. University of Kentucky Cooperative Extension warns against wood treated with creosote or pentachlorophenol in a vegetable planter, describing both chemicals as potentially toxic to plants and harmful to people. In practice that covers old railroad ties and utility poles, which are the most common creosote-treated lumber a gardener finds secondhand or free.
Newer pressure-treated lumber uses different chemistry than creosote or pentachlorophenol, and how it performs specifically as a food-container material isn’t something the extension guidance behind this warning addresses. If you’re building a planter from treated lumber and can’t confirm what it was treated with, lining the inside with a food-safe plastic liner sidesteps the question entirely, or your local cooperative extension office can tell you whether that particular treatment has been evaluated for food-crop use.
The same underlying mechanism connects the wood warning to the plastic one above: a chemical does not have to leave a visible stain or smell to have soaked into a material, and a plant’s roots draw up water — along with whatever is dissolved in it — from wherever they actually sit, not from whichever surface happens to look clean. A weathered plank or a scuffed bucket that looks harmless on the outside can still be releasing residue into the soil with every watering.
Common repurposed containers, and how the two rules apply
The two checks above — what a container is made of, and what it held before — cover most of the situations that come up when a container is inherited or found free instead of bought new. A 5-gallon bucket from a hardware store is typically a general-purpose HDPE bucket, but that alone doesn’t confirm it was made or labeled to food-contact standards; look for a stamped code and a food grade label rather than assuming a bucket is safe just because it resembles the kind a restaurant uses. A bucket that genuinely held pickles, olives, or bulk frosting clears both checks at once, which is exactly why University of Kentucky Cooperative Extension points gardeners toward restaurants, bakeries, and grocery stores as a source.
A kiddie pool repurposed as a raised bed runs into the same pair of questions: what plastic is it, and has anything besides water and children been in it. A used pool may carry sunscreen residue, pool chemicals, or years of sun-degraded plastic. Check any recycling code stamped into its plastic against the list above — a backyard toy’s history does not exempt it from that check.
Wine and whiskey barrels sidestep the plastic question entirely, since they’re wood, and their previous contents were something people drink, not a paint or solvent.
A quick check before you fill a container with soil
- Look for a recycling code of #2 or #5, a “food grade”/“FDA approved” label, or the glass-and-fork symbol, before pressing an unlabeled plastic container into service for anything edible.
- Skip #3, #6, and #7 plastics for anything that will hold soil you plan to grow food in.
- Ask what a repurposed bucket, barrel, or tub held before it reached you — a food-only history is what actually clears it, not the resin code by itself.
- Keep creosote- or pentachlorophenol-treated wood out of a food planter, and treat an unlabeled piece of treated lumber the same way until you can confirm what it was treated with.
What goes inside a food-safe container is its own separate question: a properly aged compost can still carry herbicide residue from treated hay or manure, which safe compost for edible containers covers on its own terms. Once the material itself has cleared both checks above, fabric pots vs. plastic and drainage holes cover the decisions that affect root health rather than food safety.
Sources
Choosing and prepping a container?
Material safety is one decision -- size, drainage, and what goes inside the container are separate ones covered here.
Common questions
Which plastic containers are safe for growing vegetables?
Recycling code #2 (HDPE) and code #5 (PP), per University of Maryland Extension -- look for that code stamped into the bottom, or a label reading food grade or FDA approved, or the glass-and-fork symbol. Codes #3 (PVC), #6 (polystyrene), and #7 (polycarbonate) are the ones to avoid for anything holding soil you will eat from.
Can I reuse a bucket that held paint or cleaning chemicals to grow food?
No. University of Maryland Extension is explicit that a bucket which previously held paint or a cleaning chemical does not become food-safe again, even if it is made from the food-safe #2 HDPE resin. Chemical residue can leach into damp potting mix over a season of watering.
Is pressure-treated wood safe for a vegetable planter?
Not if it was treated with creosote or pentachlorophenol -- University of Kentucky Cooperative Extension warns against both near vegetables, describing them as potentially toxic to plants and harmful to people. Newer treated lumber uses different chemistry, and if you cannot confirm what a piece was treated with, a food-safe plastic liner or a call to your local cooperative extension office settles the question before you plant.
Does a recycling code alone certify a container as food-safe?
Not by itself. The code identifies what resin the plastic is made from, not whether that specific container was manufactured to food-contact standards. University of Maryland Extension names codes #2 and #5 as the food-safe resins to look for when there is no clearer food grade or FDA approved label.