Oni was born to Nigerian parents Opeyemi and Oludotun Oni. His father is a professor at the University of Phoenix and an engineer. Oni began playing basketball at age two with a toy hoop and joined a YMCA league with his older sister at age five. From a young age, he had aspirations to play in the National Basketball Association and admired Kobe Bryant of the Los Angeles Lakers. In addition to basketball, he played football, mainly as a safety and wide receiver, and baseball.
High school career
Oni started playing high school basketball at Viewpoint School in Calabasas, California under head coach J. J. Prince. He played for the junior varsity team in his freshman season, when he stood and weighed. As a junior, Oni suffered a knee injury that sidelined him for most of the season. The injury hindered his college recruiting because he did not have film to show college coaches before his senior year. Oni stood and weighed by the time he was a senior. He had a breakout final season for Viewpoint, averaging 18 points, 9 rebounds, and 4 assists and being named California Interscholastic Federation Division 5AA player of the year. At Viewpoint, Oni did not draw interest from NCAA Division I basketball programs and was only recruited by Division III school Williams College, where he committed in the fall of his senior year of high school. However, Williams did not offer enough financial aid for his family to meet thecost of attendance. During his senior season at Viewpoint, Oni attracted attention from Yale assistant coach Matt Kingsley. After watching his highlight video in the spring of 2015, Yale head coach James Jones offered him, and Oni committed to play for the team on July 1, 2015.. However, since Yale admissions were closed, he spent his next season playing for Suffield Academy, a prep school in Suffield, Connecticut, located near Yale University. With Suffield, Oni averaged 17 points, 6 rebounds and 5 assists and earned New England Preparatory School Athletic Council Class A player of the year distinction. On February 5, 2016, he scored 52 points with 11 three-pointers versus Wilbraham & Monson Academy at the National Prep School Invitational, breaking his school record and Shabazz Napier's tournament record. Oni was named most outstanding player of the event. He was a nominee for the 2016 McDonald's All-American Boys Game.
College career
Freshman
Oni made his debut for Yale on November 13, 2016, recording a team-high 24 points, 6 rebounds, and 3 assists in a 98–90 upset win over Washington. In his next game, he posted 13 points, 10 rebounds, and a season-best 5 blocks in an 89–81 victory over Lehigh. Oni claimed Ivy League Rookie of the Week honors in each of his first three weeks with Yale. On February 25, 2017, he scored a season-high 27 points while chipping in 7 rebounds and 4 assists, in a 99–86 win over Dartmouth. By the end of the season, Oni was averaging 12.9 points, 6.3 rebounds, and 2.7 assists per game. He earned second-team All-Ivy League recognition and was named conference Rookie of the Week on five occasions during the season.
Sophomore
Entering the 2017–18 season, the Hartford Courant speculated that the Yale duo of Oni and Makai Mason could be "one of the top backcourts in the country." On November 14, 2017, his third appearance in his sophomore season, he led all scorers with 20 points in an 86–54 victory over South Carolina State. Oni erupted for 26 points, his best mark in the season, and recorded team-highs of 7 rebounds and 4 assists on November 25, in a 79–73 loss to Vermont. On February 24, 2018, he flirted with a triple-double in an 83–73 win over Columbia, matching his season-high of 26 points while leading his team with 9 rebounds and 8 assists. Through 29 games, Oni averaged 15.1 points, 6.0 rebounds, and 3.6 assists per game, leading Yale in all three categories. He tied the school record for three-pointers attempted in a single season, with 184. Oni was a three-time Ivy League Player of the Week, unanimous first-team All-Ivy League pick, and National Association of Basketball Coaches District 13 second-team selection.
Junior
Oni made his junior season debut on November 9, 2018, scoring 16 points in a 76–59 win over California at the Pac-12 China Game held in Shanghai. On November 21, he posted his first double-double of the season, leading his team with 18 points and 10 rebounds in a 79–70 loss to Vermont. On December 1, Oni scored 29 points and was named game MVP in a 77–73 victory over Miami at the Hoophall Miami Invitational. He erupted for 31 points, 9 rebounds, and 4 assists, leading his team in each category, on February 2, 2019 in an 89–68 win over Dartmouth. Oni was the first Yale player to record a 30-point game since Anthony Dallier in 2017. In his next game, a 74–60 victory over Princeton, he posted a career-high 35 points, 12 rebounds, and 3 blocks. Oni scored the most single-game points in school history since Greg Mangano in 2012. He delivered another strong performance on March 1, when he scored 30 points—shooting 9-of-11 from the field—to help Yale defeat Cornell, 88–65, and clinch a spot in the 2019 Ivy league Tournament. By the end of the regular season, Oni was averaging a team-best 17.4 points, 6.3 rebounds, and 3.6 assists per game. He was named Ivy League Player of the Year, becoming the third Yale player to win the award. In his junior season, Oni frequently attracted attention from NBA scouts, who visited all of his games to see him play. He was considered a top-50 prospect for the 2019 NBA draft and became the first Ivy League player to be drafted since 1995. In December 2018, Duke head coach Mike Krzyzewski predicted that he would be a first-round pick.
At Yale University, Oni was a major in political science. He has been praised for his academic performance, with Yale assistant basketball coach Justin Simon saying, "To maintain his grades at the level he has—the guys respect his work ethic." After being drafted, Yale allowed him to complete his degree.