A Facebook post claims that the NHS is free to use for all 500 million EU citizens. That’s a simplification—anyone who is “ordinarily resident” in the UK can get free treatment, regardless of what nationality they are, but there are limits on what people can claim as visitors.
There are 512 million people living across the EU, 446 million of whom are outside the UK, so they (and citizens of Iceland, Switzerland, Liechtenstein and Norway) could get free NHS care if they were ordinarily resident in the UK. This is easier for them under EU free movement rules than it is for citizens of non-EU countries.
Visitors who travel to England specifically for planned treatment do not receive free care, without prior special arrangement.
Visitors whose treatment was unplanned receive it for free provided they hold a European Health Insurance Card (EHIC). The framework in other parts of the UK is broadly similar.
The NHS is then allowed to recover these costs from the countries where these visitors have health insurance.
In practice the NHS doesn’t recover much of this money. In 2013/14 it was estimated it recovered less than 20% of what could be recovered from other countries.
The UK isn’t alone in having this sort of system. UK visitors to these European countries are similarly entitled to free (or discounted) state-provided healthcare for unplanned treatment under the EHIC scheme.