Sell my car to Carmax or the dealer?

Hello, I’m looking to get general feedback on whether it’s better to sell my car out right to Carmax and Carmax is giving me exactly what my current loan amount is so it can be paid off or is it better to sell my car to a dealership with the intention of purchasing another car from the same dealership?