By first principles method, we have determined the geometric configuration of K/Ba-codoped phenanthrene based on the formation energy calculations, and systematically investigated its electronic and magnetic properties. There are two bands crossing Fermi energy which mainly result from the LUMO+1 orbitals of two phenanthrene molecules in a unit cell, and the cylinder-like Fermi surface along the Γ -Z direction reflects the two-dimension character of metallic conduction of K/Ba-codoped phenanthrene. Compared to K-doped phenanthrene, K/Ba-codoping can donate more electrons to molecule to modify the electronic structure,while the intercalation of dopants does not result in the large distortion of molecule. (KBa)1phenanthrene is a magnetic metal with the spin moment of 0.32 µB per each molecule, and unexpectedly, the spins gather in one edge of molecule rather than a uniform distribution on the whole molecule. Our results demonstrate that codoping of monovalent and bivalent metals is an effective approach to modulate the electronic properties of metal-doped hydrocarbons.