Several 1-alkyl-2,3-dimethylimidazolium bis(trifluoromethanesulfonyl)imide ionic liquids (alkyl-DMimTFSI) were prepared by changing carbon chain lengths and configuration of the alkyl group, and their electrochemical properties and compatibility with Li/LiFePO4 battery electrodes were investigated in detail. Experiments indicated the type of ionic liquid has a wide electrochemical window (−0.16 to 5.2V vs. Li+/Li) and are theoretically feasible as an electrolyte for batteries with metallic lithium as anode. Addition of vinylene carbonate (VC) improves the compatibility of alkyl-DMimTFSI-based electrolytes towards lithium anode and LiFePO4 cathode, and enhanced the formation of solid electrolyte interface to protect lithium anodes from corrosion. The electrochemical properties of the ionic liquids obviously depend on carbon chain length and configuration of the alkyl, including ionic conductivity, viscosity, and charge/discharge capacity etc. Among five alkyl-DMimTFSI-LiTFSI-VC electrolytes, Li/LiFePO4 battery with the electrolyte-based on amyl-DMimTFSI shows best charge/discharge capacity and reversibility due to relatively high conductivity and low viscosity, its initial discharge capacity is about 152.6mAhg−1, which the value is near to theoretical specific capacity (170mAh g−1). Although the battery with electrolyte-based isooctyl-DMimTFSI has lowest initial discharge capacity (8.1mAhg−1) due to relatively poor conductivity and high viscosity, the value will be dramatically added to 129.6mAhg−1 when 10% propylene carbonate was introduced into the ternary electrolyte as diluent. These results clearly indicates this type of ionic liquids have fine application prospect for lithium batteries as highly safety electrolytes in the future.