A method to make magnetic random access memory with small footprint using O-ion implantation to form electrically isolated memory pillar and electric (bottom and top) leads, which are made from some oxygen gettering materials, Mg, Zr, Y, Th, Ti, Al, Ba. The doped O-ions react with metal atoms to form fully oxidized metal oxide after high temperature anneal. The method only needs two photolithography patterning and oxygen implantations and no etch and dielectric refill are needed, thus significantly reduce process cost. The method can produce extremely small MRAM cell size with perfectly vertical pillar edges (FIG. 1).