Home / Science / Agriculture and food / Animal science / Feed ration balancerTool #397

Feed ration balancer: least-cost ration and Pearson square from your own feed analyses

Enter your feeds (dry matter, protein, energy, calcium, phosphorus and price) and your animal's daily requirements, and get the cheapest mix of feeds that meets every limit, found by linear programming, plus a Pearson square for two feeds. Nothing is uploaded.

Keep it one tap away for everyday use.

Bookmark Feed ration balancer?

Press Ctrl + D now. Your browser opens its own bookmark box, where you choose the name and folder.

  1. Feeds
  2. Needs
  3. Least cost
  4. Square
Nothing is uploadedWorks offline once open

Feeds

Use your own feed analyses. Nutrients are on a dry-matter basis; the price is per kg as fed (any currency). Leave min or max empty for no limit.

The animal's daily requirements

Type the requirements for your animal (from your nutritionist, a feeding standard or your own records). Leave a box empty for no limit.

MinimumMaximum Dry matter (kg DM) Crude protein (g) Energy (MJ ME) Calcium (g) Phosphorus (g)

What it does

A ration is the daily mix of feeds an animal eats. Balancing it means choosing amounts of each feed so the animal gets enough dry matter, protein, energy and minerals, without going over any limit, at the lowest cost. This tool does that with your own numbers:

  • Least-cost ration: finds the amount of every feed (kg of dry matter per day) that meets every minimum and maximum you set at the lowest cost per day. This is a small linear programme, solved in your browser with the simplex method.
  • Pearson square: the classic pencil method for mixing two feeds to reach one target, such as 16 % crude protein. It shows the “parts” of each feed and the shares on a dry-matter and an as-fed basis.

No feed tables are built in. Use your own forage and feed analyses, and requirements from your nutritionist, a feeding standard you have access to, or your own records.

How to use it

  1. Type or paste your feeds, one per line: name, DM % (dry matter), CP % (crude protein, of the dry matter), energy per kg of DM (in any unit, such as MJ ME or Mcal NEL), Ca % and P % (of the DM), and the price per kg as fed. You can add a minimum and a maximum in kg of DM per day for any feed, for example to keep some hay in the diet or limit a by-product. Open a file reads a CSV or Excel sheet.
  2. Type the animal’s daily requirements as minimums and, if you want, maximums: dry matter intake in kg DM, protein, calcium and phosphorus in grams, and energy in the same unit as your feed list.
  3. Read the ration: kg of DM and kg as fed per feed, the share of the diet, the cost per day, and what the ration supplies against each limit. The note lists the limits reached: these are the ones that set the cost.
  4. If no ration can meet every limit, the tool tries removing each limit in turn and tells you which single limit stands in the way.
  5. Download the ration as CSV, or as an image, PDF or Word report.

Worked example

Press Use the example. It loads five made-up feeds (grass hay, maize silage, barley, soybean meal and limestone, each marked “example”) and made-up needs: 19 to 21 kg DM, at least 3000 g protein, 220 MJ ME, 100 g calcium and 60 g phosphorus. The hay has a minimum of 4 kg DM and the silage a maximum of 10 kg DM.

The cheapest ration costs 4.44 per day: 8.01 kg DM of hay, 10.00 kg DM of silage (its maximum), no barley, 2.91 kg DM of soybean meal and 0.06 kg of limestone, 41.01 kg as fed in all. It supplies exactly 3000 g protein, 220 MJ ME and 100 g calcium (those limits are reached) and 65.4 g phosphorus, more than needed. Barley is left out because, at these made-up prices, silage and hay supply energy more cheaply.

In the Pearson square, mixing the hay (10 % CP) with the soybean meal (48 % CP) to 16 % CP takes 32 parts hay and 6 parts soybean meal: 84.2 % and 15.8 % of the dry matter, or 84.4 % and 15.6 % as fed.

Tips

  • Prices are per kg as fed, because that is how feed is bought. The tool turns them into price per kg of DM itself.
  • Put a maximum on minerals and by-products, and a minimum on forage, so the cheapest answer is also a sensible diet.
  • The simplex answer is exact for the numbers you give it. Feed analyses vary, so check the ration on the animals.

FAQ

Why is a feed at 0? It costs more for what it supplies than the other feeds. Lower its price, or set a minimum, to see the cost of including it.

Can I balance amino acids or fibre? Not in this version: it covers dry matter, protein, energy, calcium and phosphorus.

Is my data uploaded? No. Everything runs in your browser and works offline. This is a planning aid, not a substitute for advice from a qualified nutritionist.

Where the numbers come from

  • Least-cost ration as a linear programme (minimise cost subject to nutrient and feed limits), solved with the two-phase simplex method and Bland's rule, as in any operations research textbook (for example Hillier and Lieberman, Introduction to Operations Research).
  • Pearson square for mixing two feeds to a target concentration: a standard animal nutrition teaching method.
  • Checked against scipy.optimize.linprog (HiGHS) on the example ration and 300 random problems (same status and the same optimum to 1 part in a million), and on the Wyndor textbook problem.
  • No feed tables or feeding standards are bundled. The example feeds and requirements are made-up round numbers for trying the tool, not real analyses or recommendations.

Standard scientific values, such as constants, atomic weights and melting points, are facts found in every textbook; we name where ours were checked. If you are an author or publisher and want a value, a credit or a table changed or removed, tell us and we will act quickly.

Last updated 2026-11-09.

Related tools

Budget planner #10 Work out what a trip, project or event will cost and how much to save each month, or plan your monthly budget with weekly and yearly bills, and see your savings grow. Breeding calendar #398 Type a mating date and get the expected due date with its window, the day for a pregnancy check and the dates to watch for heat if she does not hold. Paste a list of matings for a whole herd or flock and download it as a table (CSV) or calendar events (.ics). Nothing is uploaded. Body condition and growth curve tracker #399 Paste or open your weigh records (animal, date, weight and optional body condition score) to get the average daily gain between weighings, fit Gompertz, logistic and von Bertalanffy growth curves with mature weight and growth rate, and see the body condition trend. Nothing is uploaded. Stocking density and FCR calculator #401 Work out the water volume of a tank or pond, the biomass and stocking density of your fish, how many fish fit a target density, the feed conversion ratio (FCR) and specific growth rate (SGR) over a period, the feed per day at a % of body weight, and when the fish reach harvest weight. Nothing is uploaded. 1D Schrödinger solver #923 Choose a textbook potential, type a formula or draw your own, and get the lowest energy levels and wavefunctions of the one-dimensional Schrödinger equation by the matrix (finite-difference) method, with the exact levels alongside for the box, harmonic oscillator, finite well, Morse, linear and Pöschl–Teller potentials. Adduct and neutral loss calculator #984 Type a formula or a neutral monoisotopic mass and get the m/z of 25 common electrospray adducts in positive and negative mode, the ions left after common neutral losses (water, ammonia, CO2, sugars, phosphate and your own), and match a list of observed m/z values within a ppm tolerance. With no molecule, it turns observed m/z values into candidate neutral masses.