Gravity balancing is used to reduce the actuator effort in robotic systems. However, it is well known that conventional linear springs, directly jointed with a rotating link cannot ensure a complete gravity balancing. To achieve a complete balancing of a rotating link the zero length spring should be applied. The zero length spring corresponds to a spring with special coils ensuring zero elastic force for zero length of the spring. Therefore, the use of traditional springs, i.e. non-zero length springs, leads to adding of auxiliary mechanisms. The aim of the present study is to propose an analytically tractable solution permitting to synthesize a planar four-bar linkage that will provide a more optimal generation of the balancing moment developed by a non-zero length spring. The efficiency of the suggested linkage design is illustrated via numerical simulations. It is shown that a quasi-perfect balancing has been achieved.