How to Add a Bookmarklet in Chrome, Firefox, Safari, Edge, iPhone and Android
Installing a bookmarklet takes about five seconds on a desktop browser: show the bookmarks bar and drag the button onto it. On phones it takes a minute, because mobile browsers do not support dragging links into bookmarks. This guide covers every major browser, step by step.
New to bookmarklets? Start with What Are Bookmarklets?. Already installed one and it does nothing? Jump to Bookmarklet Not Working? 9 Fixes.
The two ways to install any bookmarklet
- Drag and drop. Every bookmarklet page on this site has a button. Drag it, do not click it, onto your bookmarks bar. The browser saves it with the code already in place.
- Paste the code into a bookmark. Create or edit any bookmark and replace its URL with the bookmarklet code, which starts with
javascript:. This is the method for phones and for situations where dragging does not work.
Whichever method you use, run the bookmarklet by clicking it from the bookmarks bar or bookmarks menu while you are on the page you want it to act on. Do not paste the code into the address bar. Most browsers deliberately block that, as explained below.
Keyboard shortcuts to show the bookmarks bar
| Browser | Windows / Linux | Mac |
|---|---|---|
| Chrome | Ctrl+Shift+B | Cmd+Shift+B |
| Edge | Ctrl+Shift+B | Cmd+Shift+B |
| Firefox | Ctrl+Shift+B | Cmd+Shift+B |
| Safari | n/a | Cmd+Shift+B (Favorites Bar) |
| Brave, Vivaldi, Opera | Ctrl+Shift+B in most versions | Cmd+Shift+B in most versions |
Google Chrome (Windows, Mac, Linux, ChromeOS)
Drag to the bookmarks bar
- Show the bookmarks bar with
Ctrl+Shift+B(Cmd+Shift+Bon Mac), or open the three-dot menu, choose Bookmarks and lists, and turn on Show bookmarks bar. - On the bookmarklet's page, press and hold the bookmarklet button, drag it onto the bar, and release.
- Right-click the new bookmark and choose Edit if you want a shorter name.
Add it manually
- Copy the bookmarklet code from its page.
- Right-click the bookmarks bar and choose Add page, or open the Bookmark Manager with
Ctrl+Shift+O(Cmd+Option+Bon Mac) and use the three-dot menu to add a new bookmark. - Type a name, paste the code into the URL field, and save.
The same steps work in Brave, Vivaldi, Opera, and other Chromium-based browsers, though menu labels differ slightly.
Mozilla Firefox
Drag to the bookmarks toolbar
- Firefox shows the bookmarks toolbar only on the new tab page by default. Press
Ctrl+Shift+B(Cmd+Shift+Bon Mac), or right-click the toolbar area, choose Bookmarks Toolbar, then Always Show. - Drag the bookmarklet button onto the toolbar.
Add it manually
- Copy the bookmarklet code.
- Right-click the bookmarks toolbar and choose Add Bookmark.
- Enter a name, paste the code into the URL field, and click Save.
Tip: in the Library (Ctrl+Shift+O), you can give a bookmark a Keyword. Type that keyword in the address bar and press Enter to run the bookmarklet without the toolbar.
Safari on Mac
Drag to the Favorites Bar
- Show the Favorites Bar with
Cmd+Shift+Bor View > Show Favorites Bar. - Drag the bookmarklet button onto the bar.
Add it manually
- Bookmark any page with
Cmd+Dand save it to Favorites. - Open Bookmarks > Edit Bookmarks (
Option+Cmd+B). - Right-click the new bookmark, choose Edit Address, paste the bookmarklet code, and press Return. Use Rename to change the name.
If a Safari bookmarklet does nothing, make sure JavaScript is enabled under Safari > Settings > Security.
Microsoft Edge
Drag to the favorites bar
- Show the favorites bar with
Ctrl+Shift+B, or go to Settings > Appearance and set Show favorites bar to Always. - Drag the bookmarklet button onto the bar.
Add it manually
- Copy the bookmarklet code.
- Right-click the favorites bar and choose Add page, or open Favorites (
Ctrl+Shift+O) and choose Add favorite. - Enter a name, paste the code as the URL, and save.
iPhone and iPad (Safari)
iOS cannot drag links into bookmarks, so you create a normal bookmark and then swap its address for the code.
- On the bookmarklet's page, copy the code. Use the copy button if there is one, or long-press the bookmarklet button and choose Copy Link.
- Bookmark any page: tap the Share button, then Add Bookmark. Give it a clear name, like "Dark Mode", and save it to Favorites so it is easy to reach.
- Tap the Bookmarks button (the open book icon), then Edit.
- Tap the bookmark you just made. Clear the address field, paste the bookmarklet code, and tap Done.
To run it: open the page you want, tap the Bookmarks button, and tap the bookmarklet. Favorites also appear when you tap the address bar on a blank page, and on iPad you can show a Favorites Bar under Settings > Apps > Safari (or Settings > Safari on older iOS versions).
Your Mac's Safari bookmarklets sync to iPhone and iPad automatically if Safari is turned on in iCloud settings, which saves you the manual steps.
Android (Chrome)
Chrome on Android saves bookmarklets fine, but it will not run them when you tap them in the bookmarks list. The trick is to run them from the address bar by name.
Add it
- Copy the bookmarklet code from its page.
- Open any page and tap the three-dot menu, then the star icon to bookmark it.
- Open the three-dot menu, then Bookmarks. Find the new bookmark, tap its three-dot menu, and choose Edit.
- Rename it to something short and unique, such as
bm dark, and replace the URL with the bookmarklet code. Save.
Run it
- Go to the page you want to use it on.
- Tap the address bar and type the bookmarklet's name, for example
bm dark. - In the suggestions, tap the entry that shows your bookmark (it displays the
javascript:address). Do not press Enter, which would search for the text instead.
Using a common prefix like "bm" for all your bookmarklets makes them easy to find from the address bar. If you use Chrome on a computer with sync turned on, bookmarklets you add there show up on your phone automatically.
Other Android browsers vary. Some Chromium-based browsers support the same address-bar trick. Firefox for Android does not run bookmarklets reliably, but it does support many add-ons instead.
Why you cannot just paste the code in the address bar
Scammers used to tell people to paste javascript: code into the address bar to "unlock" features, which actually stole their accounts. Browsers responded:
- Chrome and Edge strip the
javascript:prefix when you paste text that starts with it into the address bar. You can type it back in by hand, but a saved bookmark is far easier. - Firefox ignores
javascript:URLs typed or pasted into the address bar by default. - Safari blocks JavaScript from the address bar unless you enable it in the Develop menu.
Bookmarks are not affected by any of these protections, which is why the bookmark is the right way to run bookmarklets.
Keep your bar tidy
- Create folders on the bar, such as SEO, Dev, and Read. Bookmarklets work fine from folder dropdowns.
- Rename bookmarklets to short labels. "Canon" beats "Check Canonical Tags" when the bar is full.
- Export your bookmarks to an HTML file occasionally as a backup. Bookmarklets are included and import into any browser.
Now pick a few to try. Our list of the best bookmarklets is a good starting point, or start with this one:
Free Sticky Header Killer bookmarklet: unsticks fixed headers, hides cookie banners and overlays, and re-enables…
Frequently asked questions
Why does clicking the bookmarklet button on the site do nothing useful?
The button is meant to be dragged to your bookmarks bar, not clicked. Clicking it may just run it once on our own page or show a reminder, depending on the bookmarklet.
Can I add bookmarklets in Chrome on iPhone?
Safari is the most reliable choice on iPhone. Bookmarks you create in Safari, or sync from a Mac, can be run from the Bookmarks list on any page.
Why does my Android bookmarklet open a search instead of running?
You pressed Enter instead of tapping the bookmark suggestion. Type the bookmark name, then tap the suggestion that shows the javascript: address.
Do bookmarklets sync between devices?
Yes. They are ordinary bookmarks, so Chrome, Edge, Firefox, and Safari sync them with the rest of your bookmarks when sync is turned on.