The Earth's magnetic field can provide reliable directional information, allowing migrating animals to orient themselves using a magnetic compass or estimate their position relative to a target using map-based orientation. Here we show for the first time that young, inexperienced herring (Clupea harengus, Ch) have a magnetic compass when they migrate hundreds of kilometres to their feeding grounds. In birds, such as the European robin (Erithacus rubecula), radical pair-based magnetoreception involving cryptochrome 4 (ErCRY4) was demonstrated; the molecular basis of magnetoreception in fish is still elusive. We show that cry4 expression in the eye of herring is upregulated during the migratory season, but not before, indicating a possible use for migration. The amino acid structure of herring ChCRY4 shows four tryptophans and a flavin adenine dinucleotide-binding site, a prerequisite for a magnetic receptor. Using homology modelling, we successfully reconstructed ChCRY4 of herring, DrCRY4 of zebrafish (Danio rerio) and StCRY4 of brown trout (Salmo trutta) and showed that ChCRY4, DrCRY4 and ErCRY4a, but not StCRY4, exhibit very comparable dynamic behaviour. The electron transfer could take place in ChCRY4 in a similar way to ErCRY4a. The combined behavioural, transcriptomic and simulation experiments provide evidence that CRY4 could act as a magnetoreceptor in Atlantic herring.