Of these cars, which is the best?

Acura ILX
Honda Accord
Hyundai Sonata
Nissan Altima
Subaru Legacy

It depends on what you're after.

The ILX is in a different class of vehicle compared to all the others. It's much smaller and more compact. But it's a nice balance between sportiness, reliability, and daily drivability. Has an 8 speed dual clutch transmission which ads some extra flare.

Honda Accord is basically just a solid commuter car and not much else. Not as bland as a Toyota Camry but still not intriguing in any sense of the word. It's smooth, quiet, reliable, cheap, drives in a straight line pretty well. But that's really all it is.

Sonata is basically a value leader in the segment offering premium features found in much more expensive cars at a much cheaper price. Driving experience won't particularly "wow" you, but the Turbo option will give you sportier acceleration and handling.

Nissan Altima is basically a rental-grade vehicle with poor resale value. The CVT transmissions haven't been very reliable and in terms of feature content and interior/exterior elegance, it's much comparable to most sub-compact cars (Versa, Fiesta, Yaris, etc.)… Just in a bigger package. It's a step below mostly everything in the class. I would stay away from this one.

Subaru Legacy is basically like an Accord with AWD. It's a solid commuter car, but still relatively bland.

You won't find excitement in the midsize FWD class. I would look at the Acura ILX if I were you. The rest of the sedans you mention are all equally good, except for the Altima. The best? In what way? Value? Power? Looks? Gas mileage? Cabin space? Resell? Safety? To whom, based on what?

Are you buying brand new with money from hitting the lottery? Or did you pick it off the money tree in your back yard?

I just bought a 2012 Mazda 3 because I have been hearing good things about them for years. From Consumer Reports and elsewhere. And because I got a very good deal. Very good deals on the other cars weren't available.

To me, saving $2500-4000 was more important than brand name. Any of the others would have been fine If I found a great deal on them. (I define great deal as near wholesale)

If I was going to buy brand new, which I would never do, the Hyundai has the best warranty. But that warranty disintegrates as soon as the original owner sells it. Subaru
Honda
Acura
Hyundai
Nissan

In that order.

The best? In what way? Value? Power? Looks? Gas mileage? Cabin space? Resell? Safety?

To whom, based on what?

Are you buying brand new with money from hitting the lottery? Or did you pick it off the money tree in your back yard?

I just bought a 2012 Mazda 3 because I have been hearing good things about them for years. From Consumer Reports and elsewhere. And because I got a very good deal. Very good deals on the other cars weren't available.

To me, saving $2500-4000 was more important than brand name. Any of the others would have been fine If I found a great deal on them. (I define great deal as near wholesale)

If I was going to buy brand new, which I would never do, the Hyundai has the best warranty. But that warranty disintegrates as soon as the original owner sells it.

Subaru
Honda
Acura
Hyundai
Nissan

In that order.