The invention discloses an electric connector which comprises a male plug and a female socket, wherein the male plug comprises a battery cell bar, a battery cell bar protective casing, a pressure-resistant housing, first reset springs, a battery cell bar positioning sleeve and a housing connector; the female socket comprises an electric socket, an electric socket filling bar, a pressure-resistant housing, a sleeve, a sleeve connector, a pressing block, second reset springs, springs and a housing connector; the battery cell bar comprises a first framework, first conducting rings and first cable cores; and the electric socket comprises a second framework, second conducting rings and second cable cores. According to the electric connector, mechanical connection is realized through matching of a drill tool male connector and a drill tool female connector, information channel connection is realized through contacted matching of the first conducting rings and the second conducting rings, and connection of short sections of downhole tools is completed in a working site, so that the electric connector is fast, convenient and reliable in connection, and can prevent the first reset springs and the second reset springs from interfering cables during compression and reset; and meanwhile, rigidity compensation is achieved through third springs, so that the battery cell bar and the electric socket of the electric connector are protected from being damaged.