Both members of Yoasobi had active music careers before the formation. Ayase was active as a vocalist for the rock band Davinci from 2012 to 2018; the band disbanded in 2020. He began producing music by using Vocaloid software Hatsune Miku during his hospital treatment for peptic ulcer disease. He uploaded his first song, "Sentensei Assault Girl", on Niconico in 2018 and gained popularity with "Last Resort" a year later. He released his debut EP, Ghost City Tokyo, in December 2019. Lilas Ikuta, who adopted the stage name Ikura for Yoasobi, started performing guitar on the streets and small venues at the age of 14, and uploading her music and covers via YouTube. In 2016, she participated in Sony Music Entertainment Japan's artist training course, the Lesson, and created her demo, 15 no Omoi. Later, Ikuta joined the cover group Plusonica until 2021, and issued her first two EPs: Rerise (2018) and Jukebox (2019) via independent label After School.
In 2019, Yohei Yashiro, a founder of Monogatary.com, a social media platform for creative writing owned by SMEJ, presented the idea of a project to produce songs inspired by selected story submissions published on the website as a prize to authors instead of a book or anime adaptation, though not all were successful. Yashiro enlisted SMEJ's A&R Shuya Yamamoto to the project after they met at a party and shared the idea to him. In the mid-year, Ayase received an offer from Yashiro and Yamamoto to produce songs for the project. During the vocalist discussion, he discovered Ikura covering Aimyon's "Kimi wa Rock o Kikanai" on Instagram. He contacted her directly to recruit her to form a duo.
Yoasobi announced their debut via a teaser video on October 1, 2019. Planned to be a trial-run project, the duo first produced two songs based on the Sony Music Award winners at Monogatary.com's novel contest, Monocon 2019. They consist of "Yoru ni Kakeru" from Mayo Hoshino's short story Thanatos no Yūwaku and "Ano Yume o Nazotte" from Sōta Ishiki's Yume no Shizuku to Hoshi no Hana.
A music video for "Yoru ni Kakeru" was uploaded on November 16, 2019, and accrued one million views on YouTube within a month. The song was subsequently released to digital music and streaming platforms the next month, on December 15, independently from SMEJ's labels and distributed by the Orchard. During the beginning of the COVID-19 pandemic in early 2020, "Yoru ni Kakeru" went viral on social media, topping the Spotify's Viral Top 50 chart in January. Its The Home Take live performance by Ikura also boosted the song's popularity. Six months after its release, the song ascended to number one on the Oricon Combined Singles Chart, and the Billboard Japan Hot 100. It spent a total of six weeks atop the latter chart, of which three weeks were consecutive. Eventually, "Yoru ni Kakeru" finished 2020 as the year's number-one Japan Hot 100 song, making it the first-ever year-end chart topper with no physical release. The song won the Song of the Year at the 2020 MTV Video Music Awards Japan and the 2021 Space Shower Music Awards, and the Silver Prize at the 2023 JASRAC Awards.
Following their debut single, Yoasobi released "Ano Yume o Nazotte" on January 18, 2020. Four months later, "Halzion" was released on May 11 as part of Suntory's Immersive Song Project to advertise energy drink Zone. Sourced from Shunki Hashizume's Soredemo, Happy End, it was the duo's first collaboration with a professional novelist, whereas the first two were amateur writers. In the second half of the year, they continually released three more singles. "Tabun" was released on July 20 and was based on the short story of the same name by Shinano, which won the Yoasobi Contest Vol. 1. Used on Bourbon's Alfort Mini Chocolate commercial, "Gunjō", featuring uncredited chorus from Plusonica, was released on September 1. The song was sourced from the short story written by the brand's creative team Ao o Mikata ni, inspired by the manga series Blue Period. On December 18, the duo released the single "Haruka", a collaboration with screenwriter Osamu Suzuki for its based short story Tsuki Ōji.
On December 31, Yoasobi concluded 2020 at the year-end television special 71st NHK Kōhaku Uta Gassen with the debut live performance of "Yoru ni Kakeru" as a duo, along with the band members, filmed at Bookshelf Theater, Kadokawa Culture Museum in Tokorozawa. It made the duo the first-ever artist to perform at the TV special without any physical releases. All previously released singles were featured on the duo's debut EP The Book, released on January 6, 2021, expressing a theme of "reading CD" with binder package. It additionally included "Encore", based on Yoasobi Contest Vol. 1-winning Sekai no Owari to, Sayonara no Uta by Kanami Minakami and featured on Google Pixel 5 and Pixel 4a (5G) advertisement. The EP debuted at number two on the Oricon Albums Chart and the Billboard Japan Hot Albums. As of 2021, The Book has sold 150,000 CD and 100,000 digital sales, the latter making it the only album to reach the milestone that year, and was certified gold for the both by the RIAJ. The EP won Special Award at the CD Shop Awards.