Sophia was a member of the House of Wittelsbach and was the youngest child and only daughter of John II, Duke of Bavaria, and his spouse Catherine of Gorizia.
Sophia grew up in the care of her uncle, Frederick, Duke of Bavaria, in Landshut.