Like most carp, goldfish produce a large amount of waste both in their faeces and through their gills, releasing harmful chemicals into the water Build-up of this waste to toxic levels can occur in a relatively short period of time, and can easily cause a goldfish's death For common and comet varieties, each goldfish should have about 20 US gallons (76 l; 17 imp gal) of water Fancy goldfish (which are smaller) should have about 10 US gallons (38 l; 8.3 imp gal) per goldfish
The water surface area determines how much oxygen diffuses and dissolves into the water A general rule is have 1 square foot (0.093 m2) Active aeration by way of a water pump, filter or fountain effectively increases the surface area.
The goldfish is classified as a coldwater fish, and can live in unheated aquaria at a temperature comfortable for humans
However, rapid changes in temperature (for example in an office building in winter when the heat is turned off at night) can kill them, especially if the tank is small Care must also be taken when adding water, as the new water may be of a different temperature Temperatures under about 10 °C (50 °F) are dangerous to fancy varieties, though commons and comets can survive slightly lower temperatures
Extremely high temperatures (over 30 °C (86 °F) can also harm goldfish However, higher temperatures may help fight protozoan infestations by accelerating the parasite's life-cycle—thus eliminating it more quickly The optimum temperature for goldfish is between 20 °C (68 °F) and 22 °C (72 °F).
Like all fish, goldfish do not like to be petted
In fact, touching a goldfish can endanger its health, because it can cause the protective slime coat to be damaged or removed, exposing the fish’s skin to infection from bacteria or water-born parasites However, goldfish respond to people by surfacing at feeding time, and can be trained or acclimated to taking pellets or flakes from human fingers The reputation of goldfish dying quickly is often due to poor care. The lifespan of goldfish in captivity can extend beyond 10 years.
If left in the dark for a period of time, goldfish gradually change color until they are almost gray. Goldfish produce pigment in response to light, in a similar manner to how human skin becomes tanned in the sun
Fish have cells called chromatophores that produce pigments which reflect light, and give the fish coloration The color of a goldfish is determined by which pigments are in the cells, how many pigment molecules there are, and whether the pigment is grouped inside the cell or is spaced throughout the cytoplasm.
Because goldfish eat live plants, their presence in a planted aquarium can be problematic Only a few aquarium plant species for example Cryptocoryne and Anubias, can survive around goldfish, but they require special attention so that they are not uprooted
Plastic plants are often more durable, but the branches can irritate or harm a fish that touches one.
Various types of prepared fish food
See also: Fish food
This section does not cite any references or sources Please help improve this section by adding citations to reliable sources Unsourced material may be challenged and removed
In the wild, the diet of goldfish consists of crustaceans, insects, and various plant matter Like most fish, they are opportunistic feeders and do not stop eating on their own accord Overfeeding can be deleterious to their health, typically by blocking the intestines
This happens most often with selectively bred goldfish, which have a convoluted intestinal tract When excess food is available, they produce more waste and faeces, partly due to incomplete protein digestion Overfeeding can sometimes be diagnosed by observing faeces trailing from the fish's cloaca.
Goldfish-specific food has less protein and more carbohydrate than conventional fish food
It is sold in two consistencies—flakes that float, and pellets that sink Enthusiasts may supplement this diet with shelled peas (with outer skins removed), blanched green leafy vegetables, and bloodworms Young goldfish benefit from the addition of brine shrimp to their diet
As with all animals, goldfish preferences vary.
Behavior can vary widely both because goldfish live in a variety of environments, and because their behavior can be conditioned by their owners.
Goldfish have strong associative learning abilities, as well as social learning skills In addition, their visual acuity allows them to distinguish between individual humans Owners may notice that fish react favorably to them (swimming to the front of the glass, swimming rapidly around the tank, and going to the surface mouthing for food) while hiding when other people approach the tank
Over time, goldfish learn to associate their owners and other humans with food, often "begging" for food whenever their owners approach.
Goldfish are gregarious, displaying schooling behavior, as well as displaying the same types of feeding behaviors Goldfish may display similar behaviors when responding to their reflections in a mirror.
Goldfish that have constant visual contact with humans also stop considering them to be a threat After being kept in a tank for several weeks, sometimes months, it becomes possible to feed a goldfish by hand without it shying away.
Goldfish have learned behaviors, both as groups and as individuals, that stem from native carp behavior
They are a generalist species with varied feeding, breeding, and predator avoidance behaviors that contribute to their success As fish they can be described as "friendly" towards each other Very rarely does a goldfish harm another goldfish, nor do the males harm the females during breeding
The only real threat that goldfish present to each other is competing for food Commons, comets, and other faster varieties can easily eat all the food during a feeding before fancy varieties can reach it This can lead to stunted growth or possible starvation of fancier varieties when they are kept in a pond with their single-tailed brethren
As a result, care should be taken to combine only breeds with similar body type and swim characteristics.
Goldfish have a memory-span of at least three months and can distinguish between different shapes, colors and sounds. Goldfish vision is among the most studied of all vision in fishes  By using positive reinforcement, goldfish can be trained to recognize and to react to light signals of different colors or to perform tricks. Fish respond to certain colors most evidently in relation to feeding. Fish learn to anticipate feedings provided they occur at around the same time every day.
Goldfish may only grow to sexual maturity with enough water and the right nutrition Most goldfish breed in captivity, particularly in pond settings
Breeding usually happens after a significant temperature change, often in spring Males chase gravid female goldfish (females carrying eggs), and prompt them to release their eggs by bumping and nudging them.
Goldfish, like all cyprinids, are egg-layers Their eggs are adhesive and attach to aquatic vegetation, typically dense plants such as Cabomba or Elodea or a spawning mop
The eggs hatch within 48 to 72 hours.
Within a week or so, the fry begins to assume its final shape, although a year may pass before they develop a mature goldfish color; until then they are a metallic brown like their wild ancestors In their first weeks of life, the fry grow quickly—an adaptation born of the high risk of getting devoured by the adult goldfish (or other fish and insects) in their environment.
Some highly bred goldfish can no longer breed naturally due to their altered shape The artificial breeding method called "hand stripping" can assist nature, but can harm the fish if not done correctly
In captivity, adults may also eat young that they encounter.