A demo (shortened from "demonstration") is a song or group of songs typically recorded for limited circulation or for reference use, rather than for general public release. A demo is a way for a musician to approximate their ideas in a fixed format, such as cassette tape, compact disc, or digital audio files, and to thereby pass along those ideas to record labels, producers, or other artists.
Musicians often use demos as quick sketches to share with bandmates or arrangers, or simply for personal reference during the songwriting process; in other cases, a songwriter might make a demo to send to artists in hopes of having the song professionally recorded, or a publisher may need a simple recording for publishing or copyright purposes.
Demos are typically recorded on relatively crude equipment such as "boom box" cassette recorders, small four- or eight-track machines, or on personal computers with audio recording software. Songwriters' and publishers' demos are recorded with minimal instrumentation, usually just an acoustic guitar or piano and the vocals. Both Elton John  and Donovan gained studio experience early in their careers by recording publishers' demos for other artists since their managers also handled music publishing,  as did Garth Brooks, who was so impressed when recording the demo of " Friends in Low Places" that he asked to release the song himself. 
Many unsigned bands and artists record demos in order to obtain a recording contract. These demos are usually sent to record labels in hopes that the artist will be signed onto the label's roster and allowed to record a full-length album in a professional recording studio. However, large record labels usually ignore unsolicited demos that are sent to them by mail; artists generally must be more creative about getting the demos into the hands of the people who make decisions for the record company. Many signed bands and artists record demos of new songs before recording an album. The demos may allow the artist to provide sketches for sharing ideas with bandmates, or to explore several alternate versions of a song, or to quickly record many proto-songs before deciding which ones merit further development. Demos may include as few as one or two songs or as many as would be contained on a full-length album. With the evolution of the access to software allowing musicians to produce high quality music on their own, the amount of music released everyday has skyrocketed. With over 100,000 new songs released on Spotify every day,  the level of quality required for demos to convince record labels has also increased, and the limits between demos and actual finished recordings have become blurrier. 
Demos are seldom heard by the public, although some artists do eventually release rough demos in compilation albums or box sets, such as the album Demolicious by Green Day. Other demo versions have been unofficially released as bootleg recordings, such as The Beatles' bootleg demos and the Beach Boys' Sea of Tunes series. Several artists have eventually made official releases of demo versions of their songs as albums or companion pieces to albums, such as Florence and the Machine (" What the Water Gave Me", among others) and Cults on the EP Sunday Jams. The event of a demo tape appearing on eBay has happened in the past, with the recordings being leaked onto the internet.
In rare instances, a demo may end up as the final released recording of a song, as was the case with Foster the People's " Pumped Up Kicks". The version of "Pumped Up Kicks" that was released as a single and subsequently became a hit was a demo recorded by frontman Mark Foster alone, before he had formed the group.  In 1982, Bruce Springsteen recorded ten demo songs in his bedroom that he intended to later record with his E Street Band, but he subsequently decided that he preferred the acoustic demos and released them as the 1982 album Nebraska. 
In more underground forms of music, such as noise music, black metal, or punk rock, demos are often distributed by bands to fans as self-releases or sold at a very low price.  Amateur (and some professional) musicians may choose to make demos available to interested listeners through websites such as SoundCloud or Bandcamp in order to share new ideas, receive feedback and/or provide fans with "behind the scenes" access to the songwriting process.