a device for ventilating a fuel tank of an internal combustion engine in particular of a fuel tank of an internal combustion engine of a motor vehicle includes an activated carbon filter and at least one valve which is controllable by a control unit . to prevent leakage of hydrocarbons into the environment without enlargement of the activated carbon filter the control unit controls the valve in dependence on a load factor of the activated carbon filter and / or in dependence on an operating cycle duration of the internal combustion engine .