A small-scale, custom-made cDNA microarray, the CodStress array, consisting of 746 expressed sequence tag clones encoding stress-responsive and immune-relevant proteins was constructed to investigate the effects of contaminants on gene expression in two natural populations of Atlantic cod (Gadus morhua) from western Norway. Farmed Atlantic cod as well as cod from an unpolluted reference site were included in the present study to examine the individual variation and differences in gene expression between natural populations of cod and farmed cod. Liver of cod sampled from two contaminated sites (Store Lungegårdsvann, Bergen, Norway, and Sørfjorden, Odda, Norway), from one unpolluted reference site (Øystese/Jondal, Norway), and farmed cod were analyzed by microarray. Few differences in transcriptional levels were detected between cod from the two polluted sites and the unpolluted reference site. Cytochrome P4501A (CYP1A) and sulfotransferase 1(SULT1), two biotransformation genes, were up-regulated in males but not in females from Store Lungegårdsvann compared to the reference site. Genes related to metal-induced stress, such as heme oxygenase, ferritin, and metallothionein, were up-regulated in female cod from Sørfjorden compared to female cod from the reference site. Although many of the same contaminants are reported from both Sørfjorden and Store Lungegårdsvann, the distinction in gene expression profile between cod from these locations reflected the composition of environmental contaminants at each site. As expected, farmed fish displayed less variation in gene expression compared to the wild fish. Pearson correlation divided the farmed cod and natural cod into two principal clusters.