In this letter, two types (Type-I and Type-II) of microwave baluns with generalized structures are presented. Different from the conventional transmission-line-based baluns where transmission lines or microstrip lines are used, the proposed baluns are constructed by transmission lines with arbitrary electrical lengths. Both of the two types of baluns are designed based on a symmetric four-port structure with one of the ports open-ended. Even-odd mode method is applied to analyze the performance of these baluns. Specifically, for the Type-I design, a symmetrical impedance transformer is employed to realize the desired flexible balun function. For the Type-II design, an asymmetric impedance transforming network is applied, and a compact size is achieved. Analytical design equations have been derived for both designs. Based on these equations, two different baluns (Type-I and Type-II) have been designed, fabricated and measured. The measurement results match well with the theoretical analysis, which practically proves the design theory.Index Terms-ABCD matrix, even-odd mode, generalized balun, input impedance.