A gas sensor comprising: a gas detection unit that includes a light source configured to emit light of a predetermined wavelength toward a gas subject to detection, and a detector that receives the light and detects the gas subject to detection based on absorption of the light by the gas subject to detection; and a gas passage that includes a first end, a second end opposite to the first end, and a hollow part extending from the first end to the second end, the first end being provided toward the gas detection unit, the second end being provided toward a gas space where the gas subject to detection is located, and the gas passage being configured to communicate the gas subject to detection between the gas space and the gas detection unit via the hollow part, wherein the gas passage includes: a partition member that divides the hollow part into at least two areas including a first area and a second area each extending from the first end side to the second end side, respectively; a gas inflow port provided at the second end to connect the gas space to the first area; and a gas outflow port provided at the second end to connect the second area to the gas space, wherein the gas passage is further configured such that: the gas subject to detection located in the gas space can flow from the gas inflow port into the hollow part, can flow in the first area toward the first end, and can arrive at the gas detection unit, and the gas subject to detection located in the gas detection unit can flow in the second area toward the second end and can flow out from the gas outflow port to the gas space, characterized in that the hollow part has a shape in which a cross-sectional area of a flow passage grows smaller away from the second end and toward the first end either in steps or continuously. a gas detection unit that includes a light source configured to emit light of a predetermined wavelength toward a gas subject to detection, and a detector that receives the light and detects the gas subject to detection based on absorption of the light by the gas subject to detection; and a gas passage that includes a first end, a second end opposite to the first end, and a hollow part extending from the first end to the second end, the first end being provided toward the gas detection unit, the second end being provided toward a gas space where the gas subject to detection is located, and the gas passage being configured to communicate the gas subject to detection between the gas space and the gas detection unit via the hollow part, wherein the gas passage includes: a partition member that divides the hollow part into at least two areas including a first area and a second area each extending from the first end side to the second end side, respectively; a gas inflow port provided at the second end to connect the gas space to the first area; and a gas outflow port provided at the second end to connect the second area to the gas space, wherein the gas passage is further configured such that: the gas subject to detection located in the gas space can flow from the gas inflow port into the hollow part, can flow in the first area toward the first end, and can arrive at the gas detection unit, and the gas subject to detection located in the gas detection unit can flow in the second area toward the second end and can flow out from the gas outflow port to the gas space, characterized in that the hollow part has a shape in which a cross-sectional area of a flow passage grows smaller away from the second end and toward the first end either in steps or continuously. a partition member that divides the hollow part into at least two areas including a first area and a second area each extending from the first end side to the second end side, respectively; a gas inflow port provided at the second end to connect the gas space to the first area; and a gas outflow port provided at the second end to connect the second area to the gas space, wherein the gas passage is further configured such that: the gas subject to detection located in the gas space can flow from the gas inflow port into the hollow part, can flow in the first area toward the first end, and can arrive at the gas detection unit, and the gas subject to detection located in the gas detection unit can flow in the second area toward the second end and can flow out from the gas outflow port to the gas space, characterized in that the hollow part has a shape in which a cross-sectional area of a flow passage grows smaller away from the second end and toward the first end either in steps or continuously. the gas subject to detection located in the gas space can flow from the gas inflow port into the hollow part, can flow in the first area toward the first end, and can arrive at the gas detection unit, and the gas subject to detection located in the gas detection unit can flow in the second area toward the second end and can flow out from the gas outflow port to the gas space, characterized in that the hollow part has a shape in which a cross-sectional area of a flow passage grows smaller away from the second end and toward the first end either in steps or continuously.