An interpreter is a computer program that translates code written in a high-level programming language into machine code line by line or instruction by instruction.