AVI is a container format that can store various types of video and audio codecs, while DIVX is a codec that compresses video data using MPEG-4 technology. AVI files are widely supported by many devices and players, but they tend to be large and take up more storage space. DIVX files are smaller and offer higher quality, but they require specific players or codecs to play.