Definition:
A compiler is a program that takes code written by programmers and translates it into a language a computer can understand. The end result of this translation is a file that can be run by the computer.
Examples:
A compiler for Java is the command-line program called "javac". To compile a source code file called "HelloWorld.java" use the command:
javac HelloWorld.java
After javac has compiled the source code file, it will produce a Java class file called "HelloWorld.class".