As of 2023, an EU trademark covers 27 countries, namely:
Austria, Belgium, Bulgaria, Croatia, Cyprus, Czech Republic, Denmark, Estonia, Finland, France, Germany, Greece, Hungary, Ireland, Italy, Latvia, Lithuania, Luxembourg, Malta, Netherlands, Poland, Portugal, Romania, Slovakia, Slovenia, Spain, Sweden.
Thanks to the unitary nature of the EU, if a country leaves or joins the EU, the validity is usually adjusted accordingly, with space for exceptions and procedural changes.
For example, before BREXIT, EU trademarks were also valid in the UK. When the UK left the EU, the UKIPO created UK-valid duplicates of EU trademarks, including the original filing date, meaning the rights of the trademark owners did not change; they were simply split into multiple trademark registration. During a set transitional period, applicants with pending EU marks could apply for re-filing in the UK as well.
When applying for an EU trademark, it's best to check an up-to-date list of member states.