At 19, Shawn Fanning has a number one haircut, a half-finished degree in computer studies, and is being sued by his favourite band, Metallica. These three facts all contribute to the rather complicated mess Fanning's got himself into, and explain how a nerdy Boston college kid ended up a paper multi-millionaire, an international youth icon, and the centre of a legal storm that will ultimately decide the nature of the music industry's future.

Metallica are suing the company Fanning helped found, Napster Inc, for copyright infringement. This is because of a free piece of software written by Fanning called 'the Napster'. It's simple to download from the Net and makes it easy, for the first time, to get your hands on high-quality copies of chart music for free. Metallica, first among a list of disapproving major artists that includes Elton John, Sean 'Puffy' Combs and Dr Dre, don't like the loss of record sales that this might mean. Conversely, a host of million-selling bands including The Smashing Pumpkins, Hole, The Offspring, Cypress Hill and Limp Bizkit have come out in support of the freedom the Napster grants. A war of words and writs has erupted. And the haircut? Well, that explains how the ridiculous word 'napster' came to be on the lips of media lawyers and music pundits worldwide.

'I was playing basketball with a friend,' begins Fanning, sat on the sunny terrace of an Italian restaurant in the Silicon Valley satellite town of San Mateo. 'We were talking trash back and forth, and at that time my hair was growing out a little bit. He said I had "nappy" hair, because when it grows, it gets all curly. I got really mad at him, so he kept saying it just to piss me off.' Fanning is still sensitive about his hair and takes off his baseball cap to illustrate the next key point. 'Even though I kept my hair very short,' he says, stroking his head as if to remind himself just how much shorter he keeps it now, 'pretty soon it turned into a nickname.'

And so Fanning became the 'Napster'. At first, it was simply the log-on he used when discussing hacking in Internet chat rooms. Now it's in the top 10 most sought-after items on Internet search engines, and a recent survey found that 73 per cent of US students have used it, with more than half using it weekly. What happened between these two events may mark one of the biggest revolutions in music since man first took ecstasy.

What Napster does is find small MP3 files on the Internet. These are copies of digital quality music taken straight from CDs and left online for anyone to download and play on their computer. MP3s have been the bane of music copyrighters for a few years, but they were hard to find, and often didn't work when you got them. Napster has changed all that. It creates a directory of the best MP3s on the Net and leads you straight to them. The Napster has transformed the MP3 from a tech-head pastime into one of the prime social activities of US college life with the potential to explode internationally. And so the music industry has panicked.

Last week a black van arrived at Napster Inc's offices, and dumped 13 boxes of paperwork on its doorstep. These represented the theatrical next stage in a lawsuit from Metallica, who had asked Napster to remove their songs from its directory, saying they were violating the band's copyright. Napster said it would remove the people from the list who were trading the songs, only if Metallica named them individually. So Metallica did just that - and 300,000 names were promptly blacklisted.

'I was defensive of the band when they first filed the suit,' says Fanning. 'I thought perhaps this was industry propaganda and some lawyer capitalising on the controversy - not explaining things to Metallica fully. I got very defensive as I like the music and the band members. Lars Ulrich [drummer and songwriter] has said it's not about money, but control.' Fanning is referring to the fact that many of the songs traded on Napster are demo versions or incomplete songs. Ulrich wants to control who hears what - and when. He says Napster is 'looting our art'.

Napster has several suits against it. One is from the powerful Record Industry Association Of America. In November last year, it announced a suit for 'contributory copyright infringement' because it had noticed that most of the files on Napster were 'purloined'. Dr Dre followed Metallica by handing his list of user names last week to Napster via e-mail. Elton John slammed the lack of 'respect and compensation for creative work' that Napster showed, saying it was 'wrong to promote stealing from artists online'. Sean 'Puffy' Combs said: 'Every artist Napster abuses deserves respect.'

If the RIAA get its way, Napster could be liable for $100,000 damages for each copyright infringement. The total bill could be a sum large enough to bankrupt Bill Gates: Fanning has made powerful enemies. He has his fans, too. 'One of the artists who has publicly come out to support us is Billy Corgan of the Smashing Pumpkins. It's pretty amazing. I'm a big fan and to hear him actually explain how music will evolve online, how this is a good thing for the artist, and present a strong articulate argument - that makes me feel really good,' he says, slurping a Pepsi Max through a straw.

Fanning only got his first computer four years ago. In those years he has had one failed business - an Internet security firm he describes as 'a joke'- and written a piece of software that has catapulted him to the forefront of the intellectual property debate. He now has a small office in San Mateo, where his room - the nerve centre in a firm of 35 - smells of the banana skins that fill the bin and is adorned by a copy of Rolling Stone magazine, propped upright on his desk, with Britney Spears on the cover.

Napster began in 1998 when Fanning was at North West University in Boston. His roommate had an appetite for obscure rap music that he was feed ing with MP3s. Fanning soon picked up on his friend's frustration with MP3s and started work at his uncle's offices on something that might help. With the support of his tutors, he worked obsessively on building the computer code, fearing another company would steal the idea before he had completed it. 'I cut myself off. If I was working on something that took two or three days to implement then I would not sleep for two or three days. I got my energy from the feedback I was getting on chat rooms - and from caffeine.'

The program was released on the Net in January, and Napster soon needed more equipment to meet the demand. Fanning's uncle, John, incorporated the company this month. Since then Fanning has worked flat out. 'I don't have time to party, and if I do I'm afraid I'll lose self-control. Any efforts to establish a relationship with a girl would be pointless as I'm not sleeping much.'

He looks deep into the next glass of Pepsi as he continues coyly. 'It would be nice to have someone to... er, you know... get your mind off of work. But I want to make sure the company is in a great position before I start having fun. It's a huge opportunity because we're really popular in all these schools and it's really tempting to go and party. But I have this fear that if I get caught up it will all fall apart. Maybe I'm overestimating my importance.'

Howard King, lawyer for Metallica and Dr Dre, would not agree. 'This is the fastest-growing site ever,' King says. 'They could raise hundreds of millions of dollars if they decided to offer shares in the company. But the asset of the company is stolen music. There are colleges across the States - where the Napster is particularly popular - whose record stores are going out of business. When we win this case we will put them [Napster] out of business.'

I ask Fanning how he deals with the idea that Napster facilitates the theft of an artist's music. 'I really can't discuss that ,' he says, momentarily distracted by a passing girl. 'It has too many legal implications.' How does he feel about the high stakes of the case? What if he loses? 'It's been a good experience. I've worked as hard as I can, and can't be disappointed. I'm getting burnt out on the whole software development thing. I'm thinking of going back to school. Hanging out, chilling.'

Even if Napster loses, Fanning will have achieved something. 'It's a monumental development,' says Andy Greenwald, online editor of Spin magazine. 'The music industry hyperventilated when home-taping surfaced, but Napster is bigger in its scope. Its very nature - the trading of one song at a time - will place an emphasis on singles. In colleges one song tends to make a hot list, sweep the campus, and then be replaced by another the next week. The most positive thing it that it shows absolute passion in music.' As an LA Times editorial said, Napster is, 'in its purest form, hard-core Sixties: free love, free music'.

Back in Fanning's office, an e-mail has just arrived about a possible front cover of Time magazine. It brings home the scale of what Napster has done and irreversibly will do. And this is something of which Fanning seems both magically and alarmingly unaware.