The Electronic Calculator of the EU
Regulation (EU) No 610/2013 of 26 June 2013, amended the Convention Implementing the Schengen Agreement, the Schengen Borders Code and the Visa Code and – among others – re-defined the concept of "short stay" for third-country nationals in the Schengen area1 which is a fundamental element of the Schengen acquis.
As from 18 October 2013 for the vast majority of the third-country nationals – irrespective of being visa required or exempt – who intend to travel to the Schengen area for a short stay (contrary to reside in one of the Member States for longer than 3 months) the maximum duration of authorised stay is defined as
"90 days in any 180-day period […]". "The date of entry shall be considered as the first day of stay on the territory of the Member States and the date of exit shall be considered as the last day of stay on the territory of the Member States. Periods of stay authorised under a residence permit or a long-stay visa shall not be taken into account in the calculation of the duration of stay on the territory of the Member States."
The notion of "any", implies the application of a "moving" 180-day reference period, looking backwards at each day of the stay (be it at the entry or at the day of an actual check), into the last 180-day period, in order to verify if the 90 days / 180-day requirement continues to be fulfilled.
For the purpose of calculating the 90 days in any 180 day period you can consult the following website of the EU: https://ec.europa.eu/home-affairs/policies/schengen-borders-and-visa/border-crossing/short-stay-visa-calculator_en
In order to obtain correct results you have to use the electronic calculator in an appropriate manner, fur this purpose you’ll also will find the “PDF user’s guide” on this website