Barcelona has many public toilets, especially in parks and areas with few restaurants.

Museums, markets and other public institutions in Barcelona are obligated by law to provide public toilets.
Opening hours are important. If a market makes siesta, the toilet of that market often is closed at that time too.

Attractions Map app allows you to show only toilets that are open today.
This screen shot was made on a Sunday with fewer open toilets than usual.

Toilets for people with special needs are marked.
Download for free:
Image