No Login Data Private Local Save

Bookmarklet Generator - Online Convert JS to Browser Bookmark

16
0
0
0
Bookmarklet Generator

Convert JavaScript to Browser Bookmarklet

Paste your JavaScript code below and instantly get a ready-to-use bookmarklet. Drag it to your bookmarks bar or copy the encoded link.

0 chars
QUICK PRESETS
Show Passwords Dark Mode Extract Images Remove Sticky Edit Page Page Info Speed Up Media Translate
0 chars

Frequently Asked Questions

A bookmarklet is a browser bookmark that contains JavaScript code instead of a regular URL. When clicked, it executes the JavaScript on the current page, allowing you to modify the page, extract data, automate tasks, or enhance your browsing experience—all without installing extensions. The URL starts with javascript: followed by encoded JavaScript code.

Desktop browsers: Simply drag the "Drag to Bookmarks Bar" button from this tool directly onto your browser's bookmarks bar. Alternatively, right-click the bookmarks bar and select "Add Page," then paste the generated javascript: URL into the URL field.

Mobile browsers: Copy the generated bookmarklet code, create a new bookmark manually, and paste the code as the URL. Some mobile browsers (like Safari on iOS) support bookmarklets through the "Add Bookmark" then "Edit" workflow.

Bookmark URLs must be valid URI strings. Special characters like spaces, quotes, angle brackets, and non-ASCII characters need to be percent-encoded using encodeURIComponent() so the browser can properly interpret the JavaScript when the bookmark is clicked. Without encoding, these characters could break the URL structure or cause syntax errors. This tool handles all encoding automatically.

IIFE (Immediately Invoked Function Expression) wraps your code in (function(){ ... })();. This creates a private scope, preventing your variables from leaking into the page's global scope and avoiding conflicts with existing scripts. It also ensures the return value of your code doesn't cause the browser to navigate away. We strongly recommend keeping this option enabled for all bookmarklets.

Bookmarklets run with the same privileges as the page they're executed on. A bookmarklet you create yourself with code you trust is safe. However, never install bookmarklets from untrusted sources—they can steal cookies, capture keystrokes, or perform actions on your behalf. Always review the JavaScript code before converting it to a bookmarklet. This generator helps you create your own bookmarklets from code you control.

Yes. Most browsers impose a ~2000–4000 character limit on bookmark URLs. Chrome typically supports up to ~2000 characters, while Firefox allows longer URLs. This tool displays a real-time character count with color-coded warnings: green for safe lengths, yellow when approaching the limit, and red when exceeding typical limits. Enable Minify to reduce character count significantly.

Bookmarklets are lightweight, single-click scripts stored as bookmarks. They run only when clicked and have no background processes. Browser extensions are more powerful—they can run in the background, access browser APIs, modify all pages automatically, and persist data. Bookmarklets are great for quick, on-demand tasks while extensions suit ongoing functionality. Bookmarklets are also easier to create, share, and audit since they're just JavaScript URLs.

Yes, but installation is different. On iOS Safari, save any page as a bookmark, then edit the bookmark's URL and paste the javascript: code. On Android Chrome, you can use the address bar: type the bookmarklet's name, and Chrome will suggest the bookmarklet. Some mobile browsers have limited support, so always test your bookmarklet on target devices.

1. Open the browser's DevTools Console (F12) before clicking the bookmarklet to catch any JavaScript errors.
2. Use our Decode feature to reverse the bookmarklet back to readable JavaScript and check for syntax issues.
3. Test the raw JavaScript in the console first to verify it works.
4. Ensure the IIFE wrapper is enabled—missing it can cause scope or return value issues.
5. Check for CSP (Content Security Policy) restrictions on the target page that may block inline scripts.

Yes, but you need to dynamically load them first. A bookmarklet can inject a <script> tag into the page to load external libraries before executing dependent code. However, this adds complexity and delay. For most bookmarklets, vanilla JavaScript is recommended since modern browsers support ES6+ features natively. Keep bookmarklets self-contained for best reliability.

The easiest way is to copy the generated bookmarklet link and share it. Recipients can paste it directly into a new bookmark's URL field. For web sharing, you can create an HTML link like <a href="javascript:...">Drag me</a> that users can drag to their bookmarks bar—exactly how our "Drag to Bookmarks Bar" button works.

Minifying removes unnecessary whitespace, comments, and shortens code to reduce the total character count—critical for staying under browser URL limits. Our minifier performs basic compression (removing comments and extra whitespace) that is safe for most code. However, if your code relies on exact whitespace (e.g., in template strings), you may want to disable minification. Always test the resulting bookmarklet after minifying.