Tehran - The video shows three men and three unveiled women dancing to the song on the streets and rooftops of Tehran.
Police chief Hossein Sajedinia said the "vulgar clip" had "hurt public chastity", the ISNA news agency said.
Iran's state-run TV broadcast a programme on Tuesday, apparently showing the men and women confessing on camera.
A subtitled edition of the TV clip, posted on YouTube, identified the detainees as "actors" who claimed they were tricked into making the Happy video for an audition.
"They told me they are making a feature film and they had a permit for it," said one man in the video. "They said those things and they fooled me."
Another young woman added: "They had promised us not to publish the video."
According to some unconfirmed reports, a total of 13 people were arrested in connection with the video, but official sources have not confirmed the exact number of detainees.
Williams, whose song was nominated for an Oscar earlier this year, has protested at the arrests.
"It is beyond sad that these kids were arrested for trying to spread happiness," the singer wrote on his Facebook page.
Under Islamic law, in force in Iran since the 1979 revolution, women must cover themselves from head to toe.
Patrols of so-called "morality police" regularly enforce standards of Islamic dress on Iran's streets.
The internet is also heavily filtered in Iran, with the authorities blocking access to popular social networking sites.
The "Happy we are from Tehran" video, originally posted on 19 May, has now been seen more than 40,000 times.
At the end of the clip, the credits read: "Happy was an excuse to be happy. We enjoyed every second of making it. Hope it puts a smile on your face."
Iranian journalist Golnaz Esfandiari tweeted in response to the arrests: "Iran [is] a country where being 'happy' is a crime.
"Thousands of Iranians have been arrested in the past 35 years for being happy [and] partying."
Many Twitter users have begun using the hashtag #freehappyiranians to put pressure on the Iranian authorities to release those arrested over the video.
Williams' song has inspired hundreds of tributes since it was released last year on the soundtrack to hit animation Despicable Me 2.
The music video lasted an exhausting 24 hours - with dozens of people filmed lip-syncing and dancing to the feel-good anthem, which was played on a loop.
The clip sparked a YouTube craze, with thousands fans around the world staging their own performances of the song.
When shown a montage of the tributes on the Oprah Winfrey show last month, Williams began to cry, saying the response to the song had been "overwhelming".
In the UK, the track has reached number one on three separate occasions, while in the US it spent 10 weeks at the top of the Hot 100.
Iranian Pharrell Fans Arrested For Happy Video Tribute
The video shows several people dancing to Pharrell's number one single in and around Tehran
Latest News Headlines
- Shenzhen Travel Campaign for Summer 2019 (9)
- The Roots Perform "First Opera" For New Album (7)
- Spotify Hits 10 Million Paid Users. Now What? (7)
- Kim and Kanye Draw Crowds in Paris and Florence (7)
- Michael Jackson Album 'Xscape' Due Out May (7)
- Community Discussion: Dogs are Friends, Not Food (3)
- Explaning Why Airplane Food Is So Bad (3)
- McDonald's Tries Local Chinese Decor In Stores (3)
- Wal-Mart to Open 110 More Stores in China (4)
- High Cholesterol Levels May Impair Pregnancy (4)
- Microsoft Surprised by Chinese Ban of Windows 8 (4)
- Iranian Pharrell Fans Arrested For Happy Video Tribute (7)