🔖 Bookmarklet Generator

Converts JavaScript code into bookmarklet format. The generated link can be dragged to the bookmark bar for registration. Reverse conversion from the bookmarklet URL to the original code is also possible.

0 character
JavaScriptコードを入力してください
0 character
Bookmarklet

💡 On mobile, copy the URL above and manually paste it into your bookmark's URL to register.

Usage and Application Examples

  • Enter JavaScript code and it will be automatically converted to bookmarklet format (javascript: URI)
  • Easily register generated links by dragging and dropping them into the bookmark bar
  • Convenient bookmarklets are immediately available from the presets
  • The Reverse Conversion tab allows you to decode existing bookmarklet URLs to the original JavaScript code

What is Bookmarklet Generator?

Bookmarklet Generator transforms custom JavaScript code into executable bookmark links that run directly in your browser without external extensions. These compact scripts automate repetitive tasks, modify webpage appearance, or extract data from sites you visit frequently. Unlike browser extensions requiring installation and permissions, bookmarklets are portable, shareable, and transparent—you control exactly what code executes on each page.

How to Use

Paste your JavaScript code into the generator's input area. Enable minification to compress the code for maximum compatibility with bookmark character limits. The tool automatically wraps code with javascript: protocol syntax required for browser execution. Click the generate button to display your final bookmarklet code. Either copy the code and manually create a bookmark, or use the drag-and-drop method: drag the provided bookmark link directly to your browser's bookmark bar for instant installation. Test the bookmarklet on sample pages to verify functionality before deploying widely.

Use Cases

Bookmarklets automate common web tasks across diverse scenarios:
Productivity Automation — One-click form filling, data extraction, or content formatting on repetitive work sites
Web Development — Quick DOM inspection, console logging, or stylesheet testing without opening developer tools
Content Modification — Remove ads, hide spoilers, increase font sizes, or apply custom CSS across any website
Data Collection — Extract article metadata, scrape product information, or compile page data for analysis

Tips & Insights

Bookmarklets have inherent limitations—they operate within the same-origin policy, preventing access to cross-domain content. Minification reduces character count but sacrifices readability; maintain commented source versions separately. Many pre-built bookmarklet collections exist online for common tasks like currency conversion or grammar checking. Security considerations matter: only execute bookmarklets from trusted sources, as malicious scripts can steal form data or redirect pages. Modern Web APIs limit certain operations from bookmarklets; JSON APIs and DOM manipulation work reliably, but file access requires special permissions.

Frequently Asked Questions

What is a bookmarklet?

A bookmarklet is a small program that allows you to register JavaScript code in your browser's bookmarks (favorites) and execute it with a single click. javascript: uses a URI scheme to execute the code on the page you are currently viewing.

How do I register the bookmarklet?

Drag and drop the generated bookmarklet link onto your bookmark bar or right-click the link and select "Add to Bookmarks". Alternatively, you can copy the URL and create a bookmark manually.

What is the mini-phi option?

Enabling the minify option removes comments and unnecessary white space and line breaks from the JavaScript code and shortens the bookmarklet URL. Minify is recommended if the code is long, as browsers have URL length limitations.

Are there any security risks associated with the bookmarklet?

Bookmarklets execute JavaScript in the context of the current page, so use only trusted code. Bookmarklets from unknown sources may lead to the disclosure of personal information or tampering with the page.

Can I revert back to the original code from the bookmarklet URL?

Yes, the tool's "reverse conversion" feature allows you to paste a bookmarklet URL (a URL that begins with javascript:) and convert it to decoded, readable JavaScript code.

What if the bookmarklet does not work?

Bookmarklet may be blocked on sites with strict CSP (Content Security Policy). It will also not work if there are errors in the code. Please check the operation with the test button and confirm the error in the browser console.

How do I modify or edit a bookmarklet after creating it?

You can edit a bookmarklet by visiting this generator again, pasting the bookmarklet code in the input field, making your changes, and regenerating it. Alternatively, in most browsers, right-click the bookmark in your toolbar and select Edit to manually modify the code inline. Keep a backup of your original code in case you need to revert changes.

Can I use bookmarklets on mobile browsers?

Bookmarklets work on desktop browsers and some mobile browsers, though mobile support varies by browser—Chrome and Firefox on mobile have limited bookmarklet functionality compared to desktop. On iOS Safari, bookmarklets are supported but require creating them through a specific workaround or using specialized apps. Android browsers generally provide better bookmarklet support, though native app implementations may be necessary for complex operations.

How do I debug a bookmarklet that isn't working?

Open your browser's developer console using F12 and check the JavaScript console for error messages when executing the bookmarklet. Rewrite the bookmarklet code step-by-step in the console directly to identify which part is failing. You can also add console.log() statements to track execution and variable values during runtime.

Are bookmarklets saved if I clear my browser's history and cache?

Bookmarklets are stored separately from browser cache and history, so clearing these typically doesn't delete them—they remain in your bookmarks folder. However, clearing all browsing data or resetting browser settings may remove bookmarks depending on your browser's specific options. To be safe, periodically backup important bookmarklets by exporting your bookmarks file.

Can I create bookmarklets that combine multiple functions?

Yes, bookmarklets can contain multiple JavaScript functions executed sequentially, allowing you to build complex tools that perform several tasks in one click. You can declare functions, use loops, and implement conditional logic just like in regular JavaScript, keeping in mind that the code executes in the webpage's context. Using libraries or splitting very large bookmarklets into smaller ones may be necessary for maintainability.

What's the character limit for bookmarklet URLs?

Most browsers support bookmarklet URLs up to 2,000-4,000 characters depending on the browser, though some older browsers may have lower limits. If your bookmarklet exceeds these limits, you can minify the JavaScript more aggressively or split the functionality into multiple bookmarklets. For very large operations, consider hosting the code externally and loading it with a tiny bookmarklet that imports and executes it.