Grating lenses for optical branching were designed by introducing a phase-modulation function. The lenses have the dual functions of focusing and branching. The phase-modulation function was optimized to balance the optical intensity values for the required branchings and to suppress those for undesirable branchings. Phase-modulated grating lenses, with three and five branchings, were fabricated by using a computer and an electron-beam exposure system. The focusing and branching characteristics obtained by these lenses show excellent agreement with the theoretically predicted profiles.