Why is the past tense used in "I was wondering if you would like to come for dinner?"

Why isn't the present tense used?

I am wondering if you would like to come for dinner.


Using the past tense is a way of offering flexibility in an invitation or request. You don't need to feel compelled to accept because it is being phrased as a passing thought. A whim.


The difference between

I wonder if you'd like to come for dinner

and

I was wondering if you'd like to come for dinner

is that the second sounds more hesitant. It's used to make the invitation less direct and thus more polite. "I wonder if you'd like to come for dinner" sounds like something your boss would say, it's almost like an order to come to dinner.

There's nothing wrong with the grammar in the second form; if you are wondering now then you must have been wondering for at least a small period of time beforehand.