A humidifier for a fuel cell is provided. The humidifier includes a membrane having a humidifying membrane, a first cap coupled to a first side of the membrane to feed supply air into the humidifying membrane, and a second cap coupled to a second side of the membrane to release humidified supply air. An exhaust air inlet is coupled to the second side of the membrane to inject exhaust air from a fuel cell stack into the membrane, and an exhaust air outlet coupled to the first side of the membrane to release dehumidified exhaust air to an exhaust line. The first cap includes a supply air inflow passage and a variable member that has at least a portion capable of entering the supply air inflow passage. The variable member is moved in an inward direction or in an outward direction based on pressure inside the supply air inflow passage.