Magic encodings