A pressure sensor which detects variation in pressures, comprising: a hollow sensor main body which includes a cavity formed inside the sensor main body and a communication opening which allows the cavity and the outside of the sensor main body to communicate with each other; and a cantilever which is disposed so as to close the communication opening in a cantilever state in which a distal end portion of the cantilever is a free end and a proximal end portion thereof is supported by the sensor main body, and which is bent according to a pressure difference between the cavity and the outside of the sensor main body, wherein a gap which configures a portion of the communication opening is formed on the proximal end portion, wherein the proximal end portion is partitioned into a plurality of branch portions (22, 23) by the gap in a second direction orthogonal to a first direction in which the proximal end portion and the distal end portion are connected to each other, the first direction and the second direction being defined in a plan view of the pressure sensor, and wherein at least any one of the plurality of branch portions (22, 23) includes a displacement detection portion (25, 26) which detects displacement according to the bending of the cantilever on the basis of a change in a resistance value corresponding to the displacement, wherein a length (Wd) of the displacement detection portion (25, 26) along the second direction is shorter than a length of the branch portion (22, 23) along the second direction, characterized in that the displacement detection portion (25, 26) includes a plurality of branch detection portions (251, 252, 261, 262) which are electrically partitioned in the second direction by a partition portion having a larger resistance value than that of the displacement detection portion (25, 26), and wherein the branch detection portions (251, 252, 261, 262) are electrically connected to each other so as to wrap around the outside of the partition portion. a hollow sensor main body which includes a cavity formed inside the sensor main body and a communication opening which allows the cavity and the outside of the sensor main body to communicate with each other; and a cantilever which is disposed so as to close the communication opening in a cantilever state in which a distal end portion of the cantilever is a free end and a proximal end portion thereof is supported by the sensor main body, and which is bent according to a pressure difference between the cavity and the outside of the sensor main body, wherein a gap which configures a portion of the communication opening is formed on the proximal end portion, wherein the proximal end portion is partitioned into a plurality of branch portions (22, 23) by the gap in a second direction orthogonal to a first direction in which the proximal end portion and the distal end portion are connected to each other, the first direction and the second direction being defined in a plan view of the pressure sensor, and wherein at least any one of the plurality of branch portions (22, 23) includes a displacement detection portion (25, 26) which detects displacement according to the bending of the cantilever on the basis of a change in a resistance value corresponding to the displacement, wherein a length (Wd) of the displacement detection portion (25, 26) along the second direction is shorter than a length of the branch portion (22, 23) along the second direction, characterized in that the displacement detection portion (25, 26) includes a plurality of branch detection portions (251, 252, 261, 262) which are electrically partitioned in the second direction by a partition portion having a larger resistance value than that of the displacement detection portion (25, 26), and wherein the branch detection portions (251, 252, 261, 262) are electrically connected to each other so as to wrap around the outside of the partition portion.