Codex

The Codex is a magical crystal divided into four that opens the realm of Realix.

Opening the realm of Realix
To open the portal of Realix, the four pieces of the Codex must be brought together and a spell needs to be used. The balance between Light and Darkness must be respected to open the portal and to gain the Ultimate Power of the Realm of Realix, which is why Darkar had Bloom kidnapped and turned her into Dark Bloom.

Codex pieces
One Codex is hidden at Alfea in the hidden archive, protected by the pixie Concorda. The second Codex at Cloud Tower is hidden in the heart of the tower, guarded by Discorda. The third at Red Fountain is hidden in a weaponry base, kept hidden by Athena. The last piece of the Codex is in Pixie Village, part of the pixie's queen's sceptre, guarded by the Pixie Queen herself, Ninfea.

Season 2
Lord Darkar originally thought that the Codex was in the Pixie Village, but after gathering information through Kerborg he found that it consisted of four pieces: one in each of the three schools of Magix and a fourth piece in the Pixie Village. Each of these pieces were protected by a Guardian Pixie.

Throughout Season 2, Lord Darkar obtained the pieces of the Codex of Red Fountain, Cloud Tower and of the Pixie Village with the help of the Trix, while he got the Alfea Codex through Bloom, whom the clone of Avalon that Darkar had sent to Alfea, had temporarily infecting her with a Dark Virus, turning her into Dark Bloom for the first time.

Faragonda had a copy of each Codex piece made after Lord Darkar's return in Season 2 as a precaution in case he managed to get hold of the pieces found in the three schools and at the Pixie Village, which indeed happened. When Lord Darkar kidnapped Bloom and turned her into Dark Bloom, he then opened the portal of Realix with her help and after entering that Realm sealed the Portal.

Later, the Winx arrived to Darkar's Fortress in trying to save Bloom but were unable to enter Realix. The Guardian Pixies then used their copied Codex to open another Portal, but they had to solve the Puzzle of the Codex, which was a riddle they had to solve so as to open the Portal. The Puzzle was in the form of many color strips which had to be arranged in a specific pattern, which Stella did by following her fashion instinct and hence opening the Portal.

Nickelodeon Special: The Shadow Phoenix
In the Nickelodeon Special, there is only one Codex, which is kept in Pixie Village. Ninfea gave it to Icy after she threatened to destroy the entire village in ice. The four guardians of the Codex can open the portal to Realix without the Codex.