Skip to content
Tutorials Center
My learning

Topics

Lesson 5 of 37 ยท Ecosystems and Energy Flow

Food Chains and Food Webs

Learn producers, consumers and decomposers, how to read food chains and webs, and what happens when one species is removed from a web.

Every organism needs energy and materials. Most of that comes from food. A food chain shows who eats whom in a single line. A food web shows all the feeding links in a community, which is more realistic because most animals eat more than one thing.

Producers, consumers, decomposers

  • Producers (autotrophs) make their own food from simple substances. Most use light in photosynthesis: plants, algae, and cyanobacteria. A few bacteria use chemical energy instead.
  • Consumers (heterotrophs) eat other organisms. Primary consumers eat producers (herbivores). Secondary consumers eat primary consumers. Tertiary consumers eat secondary consumers. A top predator has no natural predators.
  • Decomposers (bacteria and fungi) break down dead organisms and waste, releasing nutrients back to the soil or water. Detritivores, such as earthworms and woodlice, eat dead material in pieces.

Reading a food chain

Arrows point in the direction energy flows, from the organism being eaten to the one that eats it.

flowchart LR
  A["Grass<br/>producer"] --> B["Grasshopper<br/>primary consumer"]
  B --> C["Frog<br/>secondary consumer"]
  C --> D["Snake<br/>tertiary consumer"]

Each arrow means "is eaten by".

A common mistake is to draw the arrow from predator to prey. Remember: the arrow shows the transfer of energy, so it points toward the eater.

From chain to web

A grasshopper is eaten by frogs, but also by birds. Frogs eat grasshoppers and beetles. Snakes eat frogs and mice. These crossing links form a web.

flowchart LR
  G["Grass"] --> H["Grasshopper"]
  G --> M["Mouse"]
  H --> F["Frog"]
  H --> B["Bird"]
  F --> S["Snake"]
  M --> S
  M --> O["Owl"]
  S --> O

A small food web. Grass is the only producer; the owl is the top predator.

You can store a web as a list of "eater: foods" and ask questions about it. This code builds the web above and finds the organisms with no predators (top predators) and those that eat only producers.

Python Analyzing a food web

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The snake and the mouse are eaten by something, so they are not top predators. The bird and owl are not eaten by anyone in this small web.

What if a species disappears?

A web shows why removing one species can have knock-on effects. If frogs vanish, grasshoppers may increase, and snakes must rely more on mice. Some species have a very large influence compared with their numbers; ecologists call them keystone species. Sea otters are a classic example: they eat sea urchins that graze kelp, so removing otters can let urchins destroy kelp forests.

This simple counter shows who loses a food source if one species is removed. It does not predict population sizes.

Python Who loses food if a species is removed?

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Notice that the more food options an animal has, the less it suffers when one is lost. Complex webs tend to be more stable than simple chains.

Real food webs are much bigger than textbook drawings. A food web diagram is a model that shows a few of the most important links.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. In a food chain, an arrow from A to B means:

    Arrows show the direction of energy transfer, from the food to the feeder.
  2. 2. Which organisms are producers?

    Algae make their own food by photosynthesis. Fungi are decomposers and zebras are consumers.
  3. 3. Why is a food web a better model than a food chain?

    Real feeding relationships overlap, which a web shows and a single chain cannot.
  4. 4. What do decomposers do?

    Bacteria and fungi release nutrients from dead organisms and waste back into the ecosystem.

Summary

  • Producers make food; consumers eat; decomposers recycle nutrients.
  • Food chains are single lines; food webs show all the links.
  • Arrows point from food to eater.
  • Removing a species affects others, especially keystone species.

Next: Trophic Levels and Ecological Pyramids