Is tourist tax mandatory?

Yes, in Venice tourist tax is mandatory.
Tourist tax is payable for the first 5 consecutive nights only and varies according to season – high season is from 1st February to 31st December and low season is January.
Children from 10 to 16 years of age are entitled to 50% off and children under 10 are free.