Short answer: there are 11 farm animals. Selling their products raw at full friendship, Pig earns the most at 1,875g a day. Made into artisan goods by an Artisan player, the order can change, so both columns are below.
Every animal, ranked
| Animal | Building | Price | Gold a day, raw | Gold a day, artisan goods | Pays back in, raw | Pays back in, best case |
|---|---|---|---|---|---|---|
| Pig | Deluxe Barn | 16,000g | 1,875g | 4,473g | 9 days | 4 days |
| Golden Chicken | Big Coop | — | 868g | 1,197g | — | — |
| Cow | Barn | 1,500g | 330g | 483g | 5 days | 3 days |
| Goat | Big Barn | 4,000g | 299g | 420g | 13 days | 10 days |
| Sheep | Deluxe Barn | 8,000g | 295g | 562g | 27 days | 14 days |
| Rabbit | Deluxe Coop | 8,000g | 175g | 271g | 46 days | 30 days |
| Chicken | Coop | 800g | 165g | 399g | 5 days | 2 days |
| Ostrich | Barn | — | 149g | 659g | — | — |
| Duck | Big Coop | 1,200g | 122g | 249g | 10 days | 5 days |
| Void Chicken | Big Coop | — | 113g | 385g | — | — |
| Dinosaur | Big Coop | — | 87g | 160g | — | — |
Raw means selling what the animal produces as it is. Best case means the artisan goods made from it with the Artisan profession, so it is the faster of the two paybacks.
Reading the table
Figures assume five hearts of friendship and maximum happiness, an average day of luck, and no hay costs. Payback is the animal's price divided by its daily income, so it ignores the building and the weeks it takes to reach full friendship. For payback that includes the Coop or Barn, and what each building level costs, see Stardew Valley Animal Prices. Animals with no price are not sold in a shop. If you are choosing between a coop and a barn first, compare the top row of each building here, then check your own numbers in the Animal Profit Calculator. For pigs in particular, Are pigs worth it? goes through the conditions.
The animal pages use the same rules. Friendship is counted in hearts of 200 points, up to five, and raises product quality (and the chance of a large product), so income climbs as you pet and feed an animal. Payback with the building counts the building's gold only: its wood and stone can be gathered, and hay and the days before five hearts are left out. Artisan goods include the Artisan profession's +40%, which raw products don't get, and a machine runs all day, so a figure below one machine per animal means one machine serves several animals.
Download this table as CSV, or see all data downloads.