A flexible yet precise method for prescribing and modifying the blade shape and the inverse design variables in two- (2D) and three-dimensional (3D) flow is presented. It is based on B-spline functions to represent curves (in 2D) and surfaces (in 3D) and enables one to approximate an existing blade shape or to specify target pressure distributions (or pressure loading). The notable characteristics of B-splines including smoothness, flexibility and robustness have made them well-suited to accurately fit both the design variables and the geometry. The precision and stability of B-splines in representing the airfoil geometry has been illustrated by interpolating generic and actual 2D airfoils. Care has been taken to enhance the representation especially in high curvature areas, e.g. LE and TE, by the proper choice of B-spline parameters. B-spline surface generation has been integrated in the extension of the present 2D inverse design into a fully three-dimensional inverse shape design. On the other hand, a method based on B-splines has been developed for generating the target pressure and loading distributions in both streamwise and spanwise directions. The method provides the designer with sufficient local control on the target profile, it is easy to use in generating smooth target pressure (or loading) curves and surfaces using a few input parameters from the designer. The developed technique is used to generate target pressure distributions or loading distribution for redesigning a highly loaded transonic turbine vane, and the rotor of a subsonic compressor stage under different operating conditions using a previously developed 2D inverse shape design method that is implemented into ANSYS-CFX where the unsteady Reynolds-Averaged Navier-Stokes equations are solved and the k-ω turbulence model is used for all test cases. The airfoils performance has been improved as a result of the target design variables meticulously tailored to satisfy all the design intents.