Bookmarklet Maker
Turn a snippet of JavaScript into a bookmarklet: a bookmark whose address is code, which runs on the current page when you click it in your bookmarks bar. The maker checks the syntax, can minify the code, wraps it so it does not clash with the page's own variables and URL-encodes it correctly. It never runs your code itself; you drag the finished link to your bookmarks bar.
Make a Bookmarklet
Only use bookmarklets made from code you wrote or fully trust. A bookmarklet runs with full access to whatever page you click it on, including your logged-in accounts there.
Your bookmarklet
Bookmarklet code
How to Use the Bookmarklet Maker
- Write or paste your JavaScript and give the bookmarklet a name.
- Keep Check syntax and minify on to catch mistakes and shorten the code.
- Press Generate.
- Drag the generated link to your bookmarks bar, or copy the code and create a bookmark manually with it as the URL.
About This Tool
Developers and power users automating small page tasks, QA testers who need one-click helpers, and teachers demonstrating how bookmarklets work.
Input: JavaScript code ยท Output: A javascript: bookmarklet link.
Features and Limitations
Features
- Syntax check and minification with Terser, without executing the code.
- Wraps the code in an immediately invoked function so it does not pollute the page.
- Correct percent-encoding of characters that break javascript: URLs (%, #, spaces, quotes).
- Shows the final length and warns when it may be too long for some browsers.
Limitations
- Bookmarklets are blocked on pages with a strict Content Security Policy (including this site, some banking sites and GitHub) and on browser pages such as the new-tab page.
- Mobile browsers make adding and running bookmarklets awkward; desktop browsers work best.
- Without the syntax check, mistakes only show up when you run the bookmarklet (look in the browser console).
- Results are computed in your browser; nothing you enter is sent to a server.
Frequently Asked Questions
Is it safe to use bookmarklets?
A bookmarklet can read and change anything on the page you run it on, including forms and data in logged-in sessions. Only use code you understand or that comes from someone you trust, just as you would with a browser extension.
Why does clicking the link here do nothing?
On purpose. The maker never runs your code: clicking the generated link only shows a reminder. Drag it to your bookmarks bar and use it on the page you want.
How do I add it if dragging does not work?
Copy the bookmarklet code, create a new bookmark (right-click the bookmarks bar, Add page), paste the code into the URL field and save it.
Why does my bookmarklet not work on some sites?
Sites with a strict Content Security Policy forbid javascript: URLs. Firefox and Chrome then block the bookmarklet; nothing in the code can work around that.
Related Tools
More like this: all Browser Helpers tools, all Browser Utilities tools or the TinySandy home page.