Under unusual circumstances, it is possible to get an AC of 49
- Highest permanent AC: 31
- Highest combat-ready AC: 35
- Highest the-stars-aligned AC: 49
Permanent AC with Magic Armor, no other Magic Items: 27
There are actually several ways to achieve this.
- Barbarian 20
- 22: Unarmored Defense = 10 + 5 (20 DEX) + 7 (24 CON)
- +5: +3 Shield
NOTE: Barbarian 20 precludes several options that require levels in other classes
- Heavy Armor
- 21: +3 Plate Mail
- +1: Defense Fighting Style (Fighter 1 or Ranger 2 or Paladin 2)
- +5: +3 Shield
- Medium Armor
- 18: +3 Half-Plate
- +3: 16 DEX or better and Medium Armor Master Feat
- +1: Defense Fighting Style (Fighter 1 or Ranger 2 or Paladin 2)
- +5: +3 Shield
Things that don't work:
- Light Armor: 26
- 15: +3 Studded Leather
- +5: 20 DEX
- +1: Defense Fighting Style (Fighter 1 or Ranger 2 or Paladin 2)
- +5: +3 Shield
- Robe of the Archmagi: 25
- 15: Robe of the Archmagi (Wizard, Sorcerer, or Warlock 1)
- +5: 20 DEX
- +5: +3 Shield
- Monk: 20
- 20: Unarmored Defense = 10 + 5 (20 DEX) + 5 (20 WIS)
- +0: Precludes shield
Adding Magic Items with Ongoing Effects (Except ones that permanently raise ability scores): 31
- +2: Staff of Power (Wizard, Sorcerer, or Warlock 1)
- +2: Choose two out of Ring of Protection, Cloak of Protection, Ioun Stone - Protection
NOTE: The Defender, because of the way it works, is considered (and rejected) as a Situational AC Boost.
Adding Combat Buffs - Consumable Magic Items and Spells: 35
- +2: Potion of Speed (effect of Haste spell, no Concentration)
- +2: Shield of Faith (Cleric 1 or Paladin 2, Concentration)
Adding Situational AC Boosts: 49
- +5: 3/4 Cover
- +4: Multiattack Defense (Ranger 7, triggered by getting hit, active for rest of attacking creature's turn)
- +5: Shield (Wizard 1, reaction to being hit, active until your next turn)
A note on the Defender: The Defender and Staff of Power are both weapons that can provide a significant AC boost. I think most characters with the choice would choose the Staff of Power. In hand it is always on and also has a +2 attack or spell DC bonus. The Defender is not in effect during any round you do not attack, including a surprise round or a round in which you Disengage or Dodge, and going max AC leaves no bonus for the attack roll. Importantly for this question, hiding behind 3/4 cover pretty much means you are not attacking, and therefore cannot shift +3 to AC. If the Defender replaced the Staff of Power and chose not to hide behind 3/4 cover, the highest AC would be 45.
Bonus Questions: What's the lowest level at which I could achieve this?
Because this doesn't rely on crazy stats, it can be achieved at a fairly low level. We have a choice between a Heavy and a Medium Armor build. Using the Medium Armor build obviates the need for Heavy Armor Proficiency (which would require a feat or 1st level in Fighter or Paladin).
Minimum Stats (easily achievable at 1st level using the default array with any PH race):
- DEX 16
- INT 13 (Wizard multiclass)
- WIS 13 (Ranger and Cleric multiclass)
Feat:
- Medium Armor Master - taken at Ranger 4, or at 1st level as a Variant Human
Minimum class level requirements:
- Ranger 7 / Wizard 1 / Cleric 1
Important Caveats
I have assumed that ability scores max out at 20 unless a class feature says otherwise. If abilities go above 20, where do they stop? I have chosen to disregard two possible ways in which characters can get ability scores over 20:
- Even without magic items, Epic Boons can be used to continue to improve abilities to 30 (DMG 230), while the characters remain "20th level" characters. Given enough time, assume all 30s.
- There are several magic items that give permanent ability boosts. The only ones worth considering here are the Tomes and Manuals which give +2 to the relevant ability but also increase the ability maximum by 2. Although, once used, they become blank for a century, there is nothing in these manuals that suggest they are unique or that they can't benefit a character multiple times. How high can your ability scores go? Per RAW and RAI, the answer to Can I increase an ability score above 30? is NO.
In either case, we no longer need Barbarian 20 for CON 24. Barbarian 1 gets access to Unarmored Defense, time/magic gets us DEX 30, CON 30, and multiclassing is possible. Highest the-stars-aligned AC becomes 57. I think this violates the spirit of the question however.
Best Answer
Permanent Max HP: 465/560
In terms of permanent HP, you can't get better than a level 20 Hill Dwarf Barbarian with the following features:
...and the following magic items:
This totals to 465 (or 560 with maximum rolls on hit dice):
145 from hit dice (240 with maximum rolls)
200 from Constitution
20 from Dwarven Toughness
40 from the Tough feat
40 from the Boon of Fortitude
20 from the berserker's axe
Temporary Max HP: 502-525/597-620
By using a luck blade to cast wish and replicating the effect of the following spells1:
...our barbarian can gain additional hit points.
Heroes' feast provides between 2 and 20 HP (an average of 11)
Aid provides either 35 or 40 HP (depending on your interpretation of whether wish replicates up to 8th level or 9th level effects; see this Q&A)
All together, this yields 502-525 for average results on hit dice, and 597-620 for maximum results on hit dice.
1 credit to Medix2 in the comments
With Temporary Hit Points: 663-686/758-781
The most temporary hit points that can be achieved is by using luck blade once more, this time to replicate mass polymorph. The spell allows you to retain your normal hit points in the new form but gain temporary hit points equal to the HP of the new form.
The best beast form to assume is the huge giant crab found in the "White Plume Mountain" module of Tales from the Yawning Portal for 161 temporary hit points. Alternatively, if your GM rules that you need to choose a standard form, you can choose the giant ape for 157 temporary hit points.