In the first week of February, Sir Tim Berners-Lee stood in front of a jury in east Texas. His task was daunting: he had to invalidate a set of patents claimed by a company called Eolas and the University of California. If he failed, almost everyone running a website with moving pictures or streaming video would have to pay a stipend to those two for each use.

Berners-Lee famously didn't patent the world wide web when he invented it as a method of tying together data from different locations on the internet. The web – confusing though it might seem – is a layer on top of the basic "internet" connection that comes into your home or office or smartphone. When asked in court why he hadn't patented his idea Berners-Lee said: "The internet was already around. I was taking hypertext" – what we see now on web pages as blue links – "and it was around [as an idea] for a long time too." (That's true: the idea of hypertext to "join" disparate pages was put forward by Ted Nelson in the 1960s.)

Berners-Lee added: "All I was doing was putting together bits that had been around for years in a particular combination to meet the needs that I have." The next question was: "Who owns the web?" To which Berners-Lee replied: "We do." All of us, and nobody. He then pointed to the existence in 1991 of a web browser called Viola, which incorporated the idea of interactivity – precisely the same ideas that Eolas and the University of California claimed to have invented in 1993.

Berners-Lee's testimony helped win the case: the patent was ruled invalid, to the relief of Google, Amazon and Yahoo, which had all been approached by Eolas, seeking payment, but which had opposed it through the legal system.

Although the Eolas case was one of the most wide-ranging patent claims made against the web – and one with enormous potential to interfere with its smooth running, as it would lay developers and website creators open to claims from Eolas and the university – it is far from the only one. Patents are increasingly being seen as a commercial threat to the smallest startups and the largest names on the web. That, in turn, threatens to close down the flowering of apps as a way to connect people with the information that they want.

The US patent system is rapidly falling into disrepute over its treatment of software. Patents were envisaged as a means of giving inventors protection from bigger companies that might want to steal their ideas without reward. Allocated by governments, they confer protection over a slice of "intellectual property" if the inventor can show that the invention fulfils two essential requirements: that it is "non-obvious" to someone already knowledgeable about the field it applies to; and that it contains an "inventive step" to achieve its outcome. In return, inventors get protection for their ideas for a set period (usually 20 years from application) and can sue anyone they think is infringing them. The idea of "lone inventor" patents is a false one, argues Mark Lemley of Stanford Law School. In a paper he points out that inventions are often "in the air", and sometimes different inventors file the same idea almost simultaneously: "We should be denying patents on the vast majority of the most important inventions, since most seem to involve near-simultaneous invention." While patents were initially applied to physical items, business growth in the last 30 years has led to companies and individuals seeking to win them in the US for software alone. Although software code is protected by copyright, patents have been seen as offering better legal rights. The US Patents and Trademarks Office (USPTO) has issued patents for software, something that has been resisted in Europe, and has led to a transatlantic split in patent practice.

"Things can be patented in the US that cannot be in Europe," says Alex Frost, partner in the hi-tech and electrical group at the patent attorneys Boult Wade Tennant, which acts in Europe for, among others, Yahoo. "There are significant differences in the legislation. It's unlikely that Europe will go the way of the US in allowing software patenting. What's patentable in the US has been tightened up in the past 10 years; there was a period in the late 1990s when it was like the wild west at the US patents office." Almost anything could get through, because the patent examiners didn't know how and where to look for "prior art" – earlier examples that would make the applied-for patent invalid. That, suggests Frost, gave the USPTO a bad name for some time.

The key difference is that in Europe, a patent must have a "technical effect", which roughly translates to something physical happening as a result of its use. So unlocking Apple's iPhone screen – which says "slide to unlock" and indicates a guide for the finger to slide along to unlock the screen – can be patented in Europe, because sliding the finger leads to a clear result: you can then interact with the screen. It's being challenged in a Dutch court. But Amazon's "One Click" method, which reduces the amount of information you have to enter to make an order online, has been turned down repeatedly by the European Patent Office (EPO). The final decision was in July 2011, when an appeal board determined that One Click was, in effect, not inventive enough, given what was known when it was devised.

That has led to a transatlantic divide in which patents that would not pass the scrutiny of the EPO have been asserted in the US and become the subject of bitter lawsuits there. The latest case involves Facebook, which is only approaching its eighth birthday. Early in March, after it had said it would make a public offering , it was hit by a patent lawsuit from, astonishingly, Yahoo, one of the biggest names online. Now under a new chief executive, Scott Thompson, Yahoo wants to benefit from what may be its only advantage over Facebook, which is bigger, more profitable, and faster growing. What Yahoo has is age – and with it a portfolio of software patents acquired or created during its life.

Yahoo is claiming that Facebook infringes 10 of its patents, including a number relating to advertising on the web, a field where it was an early entrant. Facebook said it was "puzzled" by the lawsuit, but quickly made preparations by buying a portfolio of patents from IBM, which it might be able to assert against Yahoo if the case comes to trial, or use as leverage in settlement.

The case has stirred up anger in Silicon Valley. "Look at what it is they're suing Facebook over. It's things that nearly all social services use," wrote MG Siegler, a journalist turned venture capitalist. "It's obvious things – things that existed before Yahoo patented them." But as John Lilly, former chief executive of browser company Mozilla, who is also now a venture capitalist, pointed out, companies from Apple to Amazon have been patenting and suing rivals for years. What has made the Yahoo case different is that it is no longer seen as an innovative company. For most companies, being sued by a big rival is actually a mark that you've arrived; while Facebook didn't need the validation, the lawsuit has clearly shown which of the two companies is in the ascendant. Stronger companies hardly ever sue smaller ones, because they don't need to.

That's not true of Apple, which has been suing a number of companies making products based on Google's Android mobile software – notably HTC, Samsung and Motorola – in courts in the US, Europe and even Australia, as part of a Steve Jobs-inspired battle to try to block Android's growth in return for what he saw as theft of ideas from the iPhone. But despite filing its first lawsuits almost two years ago, Apple has won only token injunctions against particular phones in some regions. Though it succeeded in blocking Samsung's Galaxy Tab tablet from sale in Australia and Germany, the bigger effect was to make the product's name better known because of media coverage, and so raise demand – hardly the outcome it would have wanted.

"These are traditional patent disputes," says Frost. "It's nothing different really from Dyson and Hoover arguing about cyclonic vacuum cleaners." But it won't have any effect on the ordinary man in the street, he thinks; nor even the software developer. There's no example of a phone company being wiped out by a patent claim; even BlackBerry-maker Research In Motion, which wound up paying $600m after losing a patent war with NTP in March 2006, went on to greater things. Its latest slump into loss, and falling handset sales – even while its patent resources have grown enormously – is because it has not been able to compete, not because it was litigated out of business.

However, for many smaller companies, software patents really can pose an existential threat. Last year a number of British developers began receiving formal letters from a company called Lodsys, which owns a number of patents that it claims cover the use of what are called "in-app purchases", where you buy some extra functionality from inside a program. Lodsys does not make or write software; it exists to make money from the patents it owns. In the lingo, it is a "patent troll", or, more politely, a "non-practising entity". Rather than using the patents to make anything, it subsists by exacting a toll from those it can persuade to pay, either through legal threats or actual lawsuits.

For independent developers – often companies with between one and five staff, not owned by any of the giant phone makers – the attention of a patent troll can make them turn away from a territory altogether. That began to happen last year as Lodsys racked up its threats against developers for both Apple and Google's Android mobile operating systems: a number of British developers simply pulled their apps from sale to US customers of Apple's App Store and Google's Android Market (since renamed Play), rather than face Lodsys patents. Outside the US, the patents are not recognised and cannot be enforced, but any transaction in the US could be targeted.

"For the small firms targeted by Lodsys, the rational thing to do is to pay the money Lodsys demands, whether or not the target believes he's actually guilty," says Timothy Lee, who has co-written a paper about the problems that software patents now pose to developers. "That's because the legal costs of defending against a patent lawsuit is likely to vastly exceed the amount of money Lodsys is demanding." It's also now impossible for any software developer to find out whether they might be infringing someone else's patents, Lee says, because it's so hard to know what to search for – unlike, say, chemists with a new formula, who can find any patents covering its creation.

Christina Mulligan, who co-wrote the paper with Lee, is a postdoctoral associate in law at Yale University. "Patents definitely threaten the open web," she said. "Patent owners have sued other companies for such banalities as using jpeg files and transmitting data typed into websites. By locking up the basic building blocks of the internet and obvious software processes, patents hamper the free flow of information and increase the financial risks associated with simple activities, such as having a website. As we discuss in our paper Scaling the Patent System, software writers and web developers couldn't discover all the patents relevant to their projects if they tried, so they are left at risk of crippling patent lawsuits for any project they do."

The money spent on patents – either acquiring them or litigating them – distracts from more productive effort, she says. "Resources that could have gone into research and development go into purchasing patents. Google acquired Motorola Mobility for $12.5bn, after Microsoft and Apple spent $4.5bn to purchase 6,000 patents from Nortel Networks. These billions could have been used to develop new products and inventions."

That also stifles future development, Lee adds. "The success of the internet has depended crucially on the existence of open, royalty-free standards, which allows anyone to create and distribute internet software. Free software products like [the free open source browser] Mozilla Firefox and the [free open source] Apache web server have been particularly important for the success of the open web.

"The threat of software patents to the open web is particularly clear in the case of video. The web is currently transitioning from proprietary Flash-based video to open video standards. The standard favoured by many firms, including Apple and Microsoft, H.264, is patent-encumbered, which makes it difficult for free software projects like Firefox to support it. Google and Mozilla have supported the WebM standard, which has many fewer patent issues."

Lee and Mulligan's straightforward financial logic is little comfort to developers who receive letters from Lodsys, which usually demands a flat 2.5% of revenues.

One British developer who declined to be named, but who has been targeted by the company, said he had considered going to a company that will use crowdsourcing to find "prior art", which would invalidate Lodsys's patents if presented as part of a lawsuit. Getting that prior art "would cost us about $25,000", he said. The alternative – settling with Lodsys, which could then go on to extract cash from other developers – would be cheaper. Lodsys has not responded to requests for comment from the Guardian.

Alex Frost has no consoling words for the developers either. "It isn't the ethos through which patents have existed for the past several hundreds of years," he says. "But as a small software developer, you'll always have this worry in the back of your mind."

• Explore the seven-day special series on the Battle for the internet