Idiom
learn off by heartknow/learn (something) (off) by heart
if you know or learn something, especially a piece of writing, by heart, you know or learn it so that you can remember it perfectly.He's my favourite poet. I know several of his poems by heart.