A hydraulic pressure generating apparatus (1 / 1A) comprising: a base body having hydraulic pressure lines (11a, 11b, 12, 14a, 14b, 14c) thereinside; a master cylinder that generates a brake hydraulic pressure by a first piston, the first piston being connected to a brake operator; and a stroke sensor that detects a position of the brake operator, wherein a rear surface of the base body faces the brake operator, and a bottomed-cylindrical-shaped first cylinder bore accommodating the first piston is opened to the rear surface of the base body, an input member that is connected to the brake operator being inserted in the first cylinder bore, wherein the stroke sensor, a plurality of solenoid valves (13, 15a, 15b, 15c) and a control unit are attached to one surface of the base body, and the stroke sensor and the solenoid valves (13, 15a, 15b, 15c) are accommodated within a housing of the control unit, the one surface lying adjacent to the rear surface of the base body, wherein the stroke sensor is disposed on a side of the one surface that lies adjacent to the rear surface of the base body, the solenoid valves (13, 15a, 15b, 15c) are disposed on the other side of the one surface that lies adjacent to a front surface of the base body, and the hydraulic pressure generating apparatus (1 / 1A) further comprises: a motor cylinder that generates a brake hydraulic pressure by a second piston using a motor as its drive source, wherein a projecting portion is formed on the one surface of the base body, wherein a bottomed-cylindrical-shaped second cylinder bore accommodating the second piston is opened to the other surface opposite to the one surface of the base body, and the motor is attached to the other surface, wherein the projecting portion is accommodated within the housing, wherein a bottom portion of the second cylinder bore is formed within the projecting portion, wherein the one surface of the base body is a side surface of the base body, characterized in that the solenoid valves (13, 15a, 15b, 15c) are disposed closer to a side of the one surface that lies adjacent to an upper surface of the base body than the center of the second cylinder bore. a base body having hydraulic pressure lines (11a, 11b, 12, 14a, 14b, 14c) thereinside; a master cylinder that generates a brake hydraulic pressure by a first piston, the first piston being connected to a brake operator; and a stroke sensor that detects a position of the brake operator, wherein a rear surface of the base body faces the brake operator, and a bottomed-cylindrical-shaped first cylinder bore accommodating the first piston is opened to the rear surface of the base body, an input member that is connected to the brake operator being inserted in the first cylinder bore, wherein the stroke sensor, a plurality of solenoid valves (13, 15a, 15b, 15c) and a control unit are attached to one surface of the base body, and the stroke sensor and the solenoid valves (13, 15a, 15b, 15c) are accommodated within a housing of the control unit, the one surface lying adjacent to the rear surface of the base body, wherein the stroke sensor is disposed on a side of the one surface that lies adjacent to the rear surface of the base body, the solenoid valves (13, 15a, 15b, 15c) are disposed on the other side of the one surface that lies adjacent to a front surface of the base body, and the hydraulic pressure generating apparatus (1 / 1A) further comprises: a motor cylinder that generates a brake hydraulic pressure by a second piston using a motor as its drive source, wherein a projecting portion is formed on the one surface of the base body, wherein a bottomed-cylindrical-shaped second cylinder bore accommodating the second piston is opened to the other surface opposite to the one surface of the base body, and the motor is attached to the other surface, wherein the projecting portion is accommodated within the housing, wherein a bottom portion of the second cylinder bore is formed within the projecting portion, wherein the one surface of the base body is a side surface of the base body, characterized in that the solenoid valves (13, 15a, 15b, 15c) are disposed closer to a side of the one surface that lies adjacent to an upper surface of the base body than the center of the second cylinder bore. a motor cylinder that generates a brake hydraulic pressure by a second piston using a motor as its drive source, wherein a projecting portion is formed on the one surface of the base body, wherein a bottomed-cylindrical-shaped second cylinder bore accommodating the second piston is opened to the other surface opposite to the one surface of the base body, and the motor is attached to the other surface, wherein the projecting portion is accommodated within the housing, wherein a bottom portion of the second cylinder bore is formed within the projecting portion, wherein the one surface of the base body is a side surface of the base body, characterized in that the solenoid valves (13, 15a, 15b, 15c) are disposed closer to a side of the one surface that lies adjacent to an upper surface of the base body than the center of the second cylinder bore.