A microcontroller is a compact integrated circuit that includes a processor, memory, and input/output peripherals, while a microprocessor only contains a processor. Microcontrollers are commonly used in embedded systems, while microprocessors are used in personal computers and other general-purpose applications.