The use of these expressions is quite idiomatic.
'Nice meeting you'
Say this when you meet someone for the first time, but say it at the end of the encounter. It's a bit like 'Goodbye'. You can also say this at the end of subsequent meetings. Although not if you meet the same person several times a day.
'Nice to meet you'
Say this as soon as you meet someone for the first time. Think of it as 'Hello, new person'.
Best wishes, Clive
AnonymousNice meeting you is in GERUND form whereas nice to meet you is in infinitive form. Both of them have the same or comparable meaning.
Still, in this expression (and probably in others as well), the -ing form seems friendlier while the to form seems colder and more formal.
At the beginning we don't know people very well so we tend to be more formal (Nice to meet you); after getting to know them we feel friendlier toward them (Nice meeting you).