A translator is used to convert high-level code into machine code. This is a set of instructions that can be directly executed by the computer's central processing unit (CPU).
An assembler translates assembly code, a low-level language, into machine code.
Compilers and interpreters are both used to translate high-level languages (such as Java and Python) into machine code. The main difference between an interpreter and compiler is that a compiler translates the whole program into machine code before the program is run. An interpreter translates code into machine code instruction by instruction.