Sir Tim Berners-Lee, the inventor of the world wide web, has called on the public and politicians to "come together" to end its misuse in a letter to mark the technology's 30th anniversary.

The founder of the World Wide Web Foundation said the internet had created opportunities for good but had also become a space used by "scammers" and "given a voice to those who spread hatred, and made all kinds of crime easier to commit".

First proposed by Sir Tim as an information management system in 1989 while he was working for the European Organisation for Nuclear Research (CERN), around half of the world's population is now online.

Many of the world's largest web-based companies, such as Facebook, Twitter and Google, have come under scrutiny in recent years over data privacy issues and the rising spread of malicious and offensive content.

In his letter, Sir Tim said it would be "defeatist and unimaginative" to assume that the web could not be changed for the better given how far it has come in its first 30 years, but urged governments, organisations and the public to work together to improve the current system and make it available to everyone.

"If we give up on building a better web now, then the web will not have failed us - we will have failed the web," he said.

He outlined what he called three sources of dysfunction that must be addressed - "deliberate, malicious intent, such as state-sponsored hacking and attacks, criminal behaviour, and online harassment"; "system design" which has created "perverse incentives where user value is sacrificed, such as ad-based revenue models that commercially reward clickbait"; and the "viral spread of misinformation".

He also called for a response to the "unintended negative consequences" of the web, which he said had led to "the outraged and polarised tone and quality of online discourse".

The letter says: "While the first category is impossible to eradicate completely, we can create both laws and code to minimise this behaviour, just as we have always done offline.

"The second category requires us to redesign systems in a way that change incentives. And the final category calls for research to understand existing systems and model possible new ones or tweak those we already have."

A global debate is currently taking place over the need for increased regulation of online spaces, with the UK Government expected to publish a White Paper on the issue in the near future.

The World Wide Web Foundation is currently developing what it calls a Contract for the Web, which aims to ensure access to the internet is recognised as a human right and is built for the public good.

"You can't just blame one government, one social network or the human spirit. Simplistic narratives risk exhausting our energy as we chase the symptoms of these problems instead of focusing on their root causes. To get this right, we will need to come together as a global web community," he said.

Sir Tim said the Foundation was working with governments and other organisations on building the contract, but called on politicians and wider society to do more to help build a better web and ensure the contract was not a "list of quick fixes".

"Governments must translate laws and regulations for the digital age. They must ensure markets remain competitive, innovative and open. And they have a responsibility to protect people's rights and freedoms online," he said.

"We need open web champions within government - civil servants and elected officials who will take action when private sector interests threaten the public good and who will stand up to protect the open web.

"Companies must do more to ensure their pursuit of short-term profit is not at the expense of human rights, democracy, scientific fact or public safety. Platforms and products must be designed with privacy, diversity and security in mind.

"And most important of all, citizens must hold companies and governments accountable for the commitments they make, and demand that both respect the web as a global community with citizens at its heart.

"If we don't elect politicians who defend a free and open web, if we don't do our part to foster constructive healthy conversations online, if we continue to click consent without demanding our data rights be respected, we walk away from our responsibility to put these issues on the priority agenda of our governments."

Sir Tim, who is due to appear at the Science Museum on Tuesday as part of the web's anniversary celebrations, concludes by labelling the need to get the rest of the world online as "urgent".

"The fight for the web is one of the most important causes of our time. Today, half of the world is online. It is more urgent than ever to ensure the other half are not left behind offline, and that everyone contributes to a web that drives equality, opportunity and creativity," he said.

"The web is for everyone and collectively we hold the power to change it. It won't be easy. But if we dream a little and work a lot, we can get the web we want."