What is the maximum number of known spells (that can be cast with spell slots and use Charisma) a character can have?


I often find it frustrating how few spells sorcerers have. This has led me to trying to increase the number of spells they have with a few multiclassing dips. I was then inspired to ask this question:

What is the maximum number of spells known a character can have?

I want this to be achieved primarily through multiclassing, so there are a few restrictions:

  • The spells must be cast using Charisma as the spellcasting modifier, so multiclassing into Wizard or Druid doesn’t help;
  • I’m not including features you’d get through subclasses (i.e. Eyes of the Dark gives you darkness for free), since I want this solution to be a template I can stick any subclasses onto;
  • A bard’s Magical Secrets is allowed, since that’s a base class feature, but Additional Magical Secrets is not, since that’s Lore bard only;
  • Feats are allowed, but Epic Boons and magic items are not;
  • I’ll allow Unearthed Arcana for this one, for example UA feats;
  • The spells known must be cast via your spell slots that you have via your class features;
  • Polymorphing into something else that can cast spells is not allowed;
  • Assume a level 20 character, and whatever ability scores are necessary (although I imagine that’ll just be Charisma 20);
  • Also note that this question has nothing to do with the number of spell slots, only spells known.