A level sensor for detecting the level of a medium, in particular a liquid medium, comprising an electrical-connection structure and at least one level-detection structure (1; 1', 1"), wherein the at least one level-detection structure (1;1', 1") comprises a plurality of elongated electrodes (3 1 -3 6; 3 1 -3 5, 3 r), which include at least three level-measuring electrodes (3 1 -3 6; 3 1 -3 5) and possibly also a calibration or reference electrode (3 r), the elongated electrodes (3 1 -3 6; 3 1 -3 5, 3 r) being electrically connected to the electrical-connection structure, wherein the elongated electrodes (3 1 -3 6; 3 1 -3 5, 3 r) extend at least partially in a length direction of the at least one level-detection structure (1; 1', 1") and each have a proximal end and a distal end (E 1 -E 6) relative to the electrical-connection structure, wherein the at least one level-detection structure (1; 1', 1") is divided, in the length direction, into a succession of level-detection sections (S1-S5; S1-S4), each of which includes two effective portions (EP 1 -EP 6; EP 1 -EP 5) of two respective said level-measuring electrodes (3 1 -3 6; 3 1 -3 5), the two effective portions (EP 1 -EP 6; EP 1 -EP 5) extending in the length direction substantially parallel or equidistant, at a first predetermined distance from each other, wherein, in one or more first level-detection sections (S2-S5; S1-S4), there also extends in the length direction a non-effective portion (NEP 1, NEP 2, NEP 3) of at least one further elongated electrode other than the two level-measuring electrodes that define the two effective portions (EP 1 -EP 6; EP 1 -EP 5) of the corresponding first level-detection section (S2-S5; S1-S4), the at least one further elongated electrode being one said level-measuring electrode (3 1 -3 6; 3 1 -3 5) or else one said possible calibration or reference electrode (3 r), wherein the elongated electrodes (3 1 -3 6; 3 1 -3 5, 3 r) are shaped in such a way that, at one or more of said first level-detection sections (S2-S5; S1-S4), the non-effective portion (NEP 1, NEP 2, NEP 3) of the at least one further elongated electrode (3 1 -3 6; 3 1 -3 5, 3 r) extends in the length direction at respective second predetermined distances (d2; d2, d2r) from the corresponding said two effective portions (EP 1 -EP 6; EP 1 -EP 5), the second predetermined distances being greater than the first predetermined distance. wherein the at least one level-detection structure (1;1', 1") comprises a plurality of elongated electrodes (3 1 -3 6; 3 1 -3 5, 3 r), which include at least three level-measuring electrodes (3 1 -3 6; 3 1 -3 5) and possibly also a calibration or reference electrode (3 r), the elongated electrodes (3 1 -3 6; 3 1 -3 5, 3 r) being electrically connected to the electrical-connection structure, wherein the elongated electrodes (3 1 -3 6; 3 1 -3 5, 3 r) extend at least partially in a length direction of the at least one level-detection structure (1; 1', 1") and each have a proximal end and a distal end (E 1 -E 6) relative to the electrical-connection structure, wherein the at least one level-detection structure (1; 1', 1") is divided, in the length direction, into a succession of level-detection sections (S1-S5; S1-S4), each of which includes two effective portions (EP 1 -EP 6; EP 1 -EP 5) of two respective said level-measuring electrodes (3 1 -3 6; 3 1 -3 5), the two effective portions (EP 1 -EP 6; EP 1 -EP 5) extending in the length direction substantially parallel or equidistant, at a first predetermined distance from each other, wherein, in one or more first level-detection sections (S2-S5; S1-S4), there also extends in the length direction a non-effective portion (NEP 1, NEP 2, NEP 3) of at least one further elongated electrode other than the two level-measuring electrodes that define the two effective portions (EP 1 -EP 6; EP 1 -EP 5) of the corresponding first level-detection section (S2-S5; S1-S4), the at least one further elongated electrode being one said level-measuring electrode (3 1 -3 6; 3 1 -3 5) or else one said possible calibration or reference electrode (3 r), wherein the elongated electrodes (3 1 -3 6; 3 1 -3 5, 3 r) are shaped in such a way that, at one or more of said first level-detection sections (S2-S5; S1-S4), the non-effective portion (NEP 1, NEP 2, NEP 3) of the at least one further elongated electrode (3 1 -3 6; 3 1 -3 5, 3 r) extends in the length direction at respective second predetermined distances (d2; d2, d2r) from the corresponding said two effective portions (EP 1 -EP 6; EP 1 -EP 5), the second predetermined distances being greater than the first predetermined distance.