Compost Calculator
Work out the real carbon-to-nitrogen ratio of a compost pile by mass, find how much more of one material it needs, and check the pile is big enough to heat.
How to use this calculator
- 1Weigh what you are adding rather than eyeballing barrow-loads. A bathroom scale and a bucket is enough, and it is the step that makes the whole calculation meaningful.
- 2Enter weights as delivered — wet, exactly as they go on the heap. The moisture correction is applied for you, and it is where the folk rules go wrong.
- 3Pick the material closest to what you actually have. Published C:N figures are ranges, so the nearest match is fine.
- 4Build the pile at least 3 ft in every direction. Below that it will not hold heat no matter how good the mix is.
- 5Check moisture by squeezing a handful — it should feel like a wrung-out sponge and release a drop or two.
- 6Turn the pile when the temperature falls off its peak, typically after four or five days. Three or four turns takes a hot pile to finished compost in six to eight weeks.
How the calculation works
For each material: dry matter = weight as delivered × (1 − moisture)
Blended C:N = Σ dry matter ÷ Σ (dry matter ÷ material C:N)
Carbon is a near-constant fraction of dry matter across organic materials,
so it cancels out of the ratio and never has to be estimated.
Moisture = Σ water ÷ Σ weight as delivered
Pile volume = length × width × height, and 27 cu ft is the minimum that self-heats- C:N
- Parts of carbon per part of nitrogen, by mass of dry matter. The target for fast composting is 25 to 30
- Dry matter
- What is left after the water. The only part of a material that carries carbon and nitrogen
- Moisture
- Water as a fraction of the delivered weight. Target 50 to 60% in the finished mix
- Thermophilic
- The 130–160°F phase where heat-loving bacteria dominate. Three days above 131°F kills most weed seed and pathogens
Carbon content is assumed to be a constant fraction of dry matter, which is close enough across plant and animal materials that it cancels out of the ratio entirely.
Published C:N figures for a material are ranges, not constants — leaf litter varies with species and age, manure with diet and bedding. Treat the result as a good estimate, not a measurement.
A pile below about 27 cubic feet loses heat through its surface faster than the bacteria inside generate it, regardless of how well balanced the mix is.
Worked example
The classic autumn pile: leaves, grass clippings and kitchen scraps
- 1.Dry leaves: 40 lb at 35% moisture = 26.0 lb of dry matter, at C:N 60:1.
- 2.Grass clippings: 30 lb at 80% moisture = 6.0 lb of dry matter, at C:N 17:1.
- 3.Kitchen scraps: 15 lb at 80% moisture = 3.0 lb of dry matter, at C:N 15:1.
- 4.Total dry matter = 35.0 lb.
- 5.Nitrogen units = 26.0/60 + 6.0/17 + 3.0/15 = 0.433 + 0.353 + 0.200 = 0.986.
- 6.Blended ratio = 35.0 ÷ 0.986 = 35.5:1.
- 7.That looks like a sensible pile — roughly half leaves by weight, plenty of green material — and it is carbon-heavy enough to be slow.
- 8.The reason is water. Forty-five pounds of grass and scraps went on the heap and contributed nine pounds of dry matter between them.
- 9.Moisture works out at 59%, which is in the right band, and a 4 ft cube is 64 cubic feet — well above the 27 needed to self-heat.
- 10.So the pile is the right size and the right wetness, and still too carbon-rich to get properly hot.
Result: 35.5 : 1 — carbon-heavy, because four fifths of the green material was water
The same leaves, with enough grass to actually balance them
- 1.Same 40 lb of leaves and 15 lb of scraps, but 110 lb of grass instead of 30.
- 2.Grass dry matter = 110 × 0.20 = 22.0 lb, at C:N 17:1.
- 3.Total dry matter = 26.0 + 22.0 + 3.0 = 51.0 lb.
- 4.Nitrogen units = 0.433 + 22.0/17 + 0.200 = 0.433 + 1.294 + 0.200 = 1.927.
- 5.Blended ratio = 51.0 ÷ 1.927 = 26.5:1 — inside the target band.
- 6.By weight that is nearly three parts grass to one part leaves, which is the opposite of the "two parts browns to one part greens" rule.
- 7.Both statements are true at once: two parts browns to one part greens *by volume* of loose material can be close to right, while by weight it looks like this. Weighing removes the ambiguity.
- 8.Moisture rises to 69%, which is now too wet — so the real fix is to add the grass and some dry shredded leaves or cardboard together, and turn it.
Result: 26.5 : 1 on nearly three parts grass to one of leaves — by weight
Why browns and greens is not enough
The two-parts-browns-to-one-part-greens rule is repeated in every gardening book, and it is a reasonable starting point for exactly one pairing: dry autumn leaves and fresh grass clippings, measured loose by volume. Change either material and it stops being reliable.
The reason is that "brown" and "green" are compressing an enormous range into two words. Chicken manure sits at about 10:1. Sawdust sits at about 500:1. Both are ordinary compost inputs, and one is fifty times more carbon-rich than the other. Straw at 80:1 and dry leaves at 60:1 are both browns, and swapping one for the other changes the nitrogen requirement by a third.
The second problem is water, and it is the bigger one. A material’s carbon and nitrogen are in its dry matter, and fresh grass clippings are four fifths water. Thirty pounds of grass on the heap contributes six pounds of dry matter. Forty pounds of dry leaves contributes twenty-six. The barrow-load intuition that the two are comparable is off by more than a factor of four.
Weighing the inputs and working on dry mass removes both problems, and the answer it gives is usually that the pile needs far more nitrogen material than it looks like it should.
What the bacteria are actually doing
Composting is bacteria eating, and the ratio matters because of what they are building.
Micro-organisms use carbon as an energy source and nitrogen to build protein. The proportions they need are roughly thirty parts carbon per part of nitrogen once respiration losses are accounted for — which is why 25 to 30:1 is the target and not some other number.
Above about 35:1 the nitrogen runs out first. The bacteria have plenty of fuel and nothing to build cells with, so populations stay small, decomposition is slow, and the pile never generates enough heat to matter. This is the failure mode behind almost every heap that sits unchanged for a year.
Below about 20:1 the carbon runs out first, and the surplus nitrogen has nowhere to go. It leaves as ammonia — which is both the smell of a badly built pile and the loss of exactly the nutrient the compost was supposed to deliver. A grass-clippings-only heap does this within a day.
Get the ratio right and the population explodes. Temperature climbs to 130–150°F within a few days, thermophilic bacteria take over from the mesophilic ones that started, and the material breaks down in weeks rather than seasons.
Size, air and water: the three that are not the ratio
A perfect C:N ratio in a pile that is too small, too wet or too dense will still do nothing.
- Size — a pile generates heat throughout its volume and loses it through its surface. Below about a 3 ft cube — 27 cubic feet — the surface wins and the pile stays at air temperature. This is why compost tumblers rarely get properly hot: most hold well under 27 cubic feet.
- Moisture — target 50 to 60%. Below 40% the bacteria stop; above 65% water fills the air spaces and the pile goes anaerobic. The squeeze test is reliable: a handful should feel like a wrung-out sponge and release a drop or two.
- Air — aerobic decomposition is fast and does not smell; anaerobic is slow and smells of sulphur and ammonia. Structure keeps air in — coarse material, twigs, a base layer of chipped wood — and turning restores it when the pile settles.
- Particle size — smaller pieces have more surface for bacteria to work on and break down faster, but material shredded too fine mats down and excludes air. Shredded leaves compost far faster than whole ones; sawdust is fine enough to seal a pile solid.
- Turning — moves the cool outside into the hot middle, restores air, and restarts the temperature cycle. Three or four turns over six to eight weeks is a fast pile. Never turning also works and takes about a year.
Heat, weed seed and what not to put in
The practical argument for a hot pile rather than a cold heap is sanitation, and it has a number attached to it.
Three consecutive days above 131°F kills most weed seeds and plant pathogens, and it is the basis of the standards applied to commercial compost. A cold heap does not reach it, which is why cold-composted material reliably grows a crop of whatever went into it. Turning matters here too: seed on the outside of the pile never got hot, so it has to be moved to the middle at least once.
Some things do not belong in a garden pile regardless of temperature. Meat, fish, dairy and cooked food attract rodents and go anaerobic. Dog and cat faeces carry parasites that survive ordinary composting. Diseased plant material is a gamble unless you are confident the pile gets properly hot — and most do not, consistently.
Two less obvious ones are worth knowing. Black walnut leaves and bark contain juglone, which persists through composting and suppresses tomatoes, peppers and several other crops. And manure or hay from an unknown source can carry aminopyralid and clopyralid — persistent broadleaf herbicides that survive both the animal and the compost pile, and that will deform or kill tomatoes and beans in the following season. If you bring in manure, test it first by sprouting a few beans in a pot of it.
What this assumes, and where it stops
Assumptions
- Carbon is treated as a constant fraction of dry matter across all materials, which allows it to cancel out of the ratio.
- Material C:N ratios and moisture contents are typical published values; both vary with source, age and handling.
- Weights are entered as delivered, and the moisture fraction converts them to dry matter.
- A pile of at least 27 cubic feet with no dimension below about 2.5 ft is treated as capable of self-heating.
- Finished compost is estimated at about 35% of the starting volume.
Limitations
- Published C:N figures are ranges rather than constants. Leaf litter varies by species and age, manure by diet and bedding, and the same material can differ by a factor of two between sources.
- Moisture content as delivered varies enormously with weather — leaves after rain are nothing like leaves off a dry lawn.
- The calculation says nothing about particle size, structure or air, all of which can stop a perfectly balanced pile from working.
- Persistent herbicide contamination in imported manure or hay is not detectable from any of these inputs and will survive composting. Sprout-test unknown material before using it.
- Reaching and holding 131°F depends on management as much as on the mix, and this page cannot predict whether a given pile will actually be turned.
Common questions
What is the ideal carbon to nitrogen ratio for compost?
Twenty-five to thirty parts carbon per part nitrogen, by mass of dry matter. That is roughly what micro-organisms need to build cell protein while respiring the rest as energy. Above about 35:1 the pile runs short of nitrogen and stays cold; below about 20:1 the surplus nitrogen escapes as ammonia, which is both the smell and a loss of the nutrient you wanted.
Why is my compost pile not heating up?
Usually one of three things. The mix is too carbon-rich — very common, because green material is mostly water and contributes far less dry matter than it appears to. The pile is too small: below about 27 cubic feet it loses heat faster than it makes it. Or it is too dry, since below about 40% moisture the bacteria simply stop working.
Is the two parts browns to one part greens rule wrong?
It is a reasonable approximation for loose volumes of dry autumn leaves and fresh grass clippings, and unreliable for anything else. Material ratios span from 10:1 for chicken manure to 500:1 for sawdust, and green material is typically four fifths water. Weighing the inputs and working on dry mass gives an answer that holds for whatever you actually have.
How big does a compost pile need to be?
At least three feet in every direction — about 27 cubic feet. A pile makes heat throughout its volume and loses it through its surface, so below that size the surface wins and it stays at air temperature. This is also why most tumblers never get properly hot: they hold well under 27 cubic feet.
How wet should compost be?
Fifty to sixty percent moisture. The test is a squeezed handful: it should feel like a wrung-out sponge and release a drop or two, no more. Below 40% the bacteria stop; above 65% water fills the air spaces, the pile goes anaerobic, and that is where the sulphur smell comes from.
What should never go in a compost pile?
Meat, fish, dairy and cooked food, which attract rodents and go anaerobic. Dog and cat faeces, which carry parasites that survive composting. Black walnut, whose juglone persists and suppresses tomatoes. And manure or hay from an unknown source, which can carry persistent broadleaf herbicides that survive both the animal and the pile — sprout-test a few beans in it first.
Sources
- Composting at home — US Environmental Protection Agency
- Reducing wasted food at home — composting basics — US Environmental Protection Agency
- Soil health and organic matter management — USDA Natural Resources Conservation Service
Formula and content last reviewed on .
Results are estimates for information only, not professional advice.
Related calculators
Tools people commonly use alongside the compost calculator.