Adjusted close is the right base
Adjusted close accounts for stock splits and distributions. Without it, a historical return calculator can understate or distort long-term performance.
For SPY and QQQ pages, this should be stated directly on-page so users understand the result includes reinvested corporate actions where the data source supports it.