How to Create a Wayback Machine Bookmarklet in Five Minutes

We’ve all felt that sinking feeling: a click on a bookmarked link yields only a barren 404 error. The page is gone, vanished into the digital ether. While services like the Internet Archive’s Wayback Machine are incredible resources, navigating to their site and manually pasting a URL can feel like a chore in the heat of the moment. There’s a simpler way: a bookmarklet. This tiny piece of code lives in your browser’s bookmarks bar, and with one click, it can instantly check the archives for the page you’re currently viewing.

A bookmarklet is a bookmark that contains JavaScript code instead of a web address. When you click it, it runs that code on the active page. For our purposes, we want a script that takes the URL of the current page and sends it directly to the Wayback Machine. It’s a powerful tool that turns a multi-step process into a single, reflexive action.

Building Your Archiving Tool

The code itself is surprisingly simple. All it needs to do is redirect your browser to the Wayback Machine’s capture of your current page. Here is the exact JavaScript snippet you’ll need:

javascript:window.location.href='https://web.archive.org/web/'+window.location.href;

To create the bookmarklet, first, ensure your browser’s bookmarks bar is visible. Next, create a new bookmark. In the "Name" or "Title" field, give it a clear label like "Archive This Page" or "Wayback It." Now, the crucial part: instead of a normal web address, paste the entire code snippet above into the "URL" or "Location" field. Save the bookmark.

That’s it. You’ve just built a personal digital preservation tool. The next time you’re on a page you fear might not last—a news article, a project portfolio, a community forum post—click your new bookmarklet. Your browser will immediately jump to the Wayback Machine’s saved copies of that page, if they exist. If no archive exists yet, you’ll be taken to a page where you can choose to save it yourself, contributing to the public record.

This technique embeds the act of preservation directly into your browsing habits. It’s a low-friction, high-reward practice that empowers you to not only rescue lost content for yourself but also to actively participate in building a more durable web for everyone. It turns a reactive sigh into a proactive click.

Notes & further reading

A few pages I came back to while writing this: