As we know that programmer writes the program in high level language which is easily human understandable but Computer only understands the language of 0’s and 1’s which is called machine language. Human cannot understand machine language easily. Assume that a programmer writes the program in machine language, if an error occurred it is very diffult to find. This translation is accomplished by the Compiler and Interpreter.
A complier is a program which converts human understandable language which is taken as input to machine understandable language for proccessing it and then converts it back to human understandable language to give output to user.
An interpreter also does the same thing. The main difference between both of these are that compiler takes whole program as input to translate it into machine language but interpreter does this job line by line.