Bookmarklet Builder
Wraps a JavaScript snippet as a bookmarklet (javascript: link) ready to drag to the bookmarks bar.
Turning a JS snippet into a browser button
There is that little piece of JavaScript you paste into the console every week: highlight broken links, copy the page title, kill an annoying overlay. Opening devtools every single time gets old fast. The classic answer is a bookmarklet, a bookmark whose URL starts with javascript: and runs against whatever page is open. This builder wraps your snippet in the right shape.
What it does is collapse all whitespace to single spaces, wrap the code in (function(){ ... })(); and prefix it with javascript:. That wrapper is not decoration: because the function returns undefined, the browser stays on the page instead of replacing it with your code's return value. The collapsing has a real cost though. Everything becomes one line, so any double-slash comment swallows the rest of the code. Use block comments, or none at all.
The output here is plain text: a sample link and a URL line. Despite what the name suggests, there is no draggable link on the page, so create a bookmark by hand and paste the URL into its address field. Keep in mind that a bookmarklet runs with the open page's privileges, cookies and session included, so never paste code from a source you do not trust. Some sites with strict CSP still break bookmarklets, and behaviour varies by browser. Packaging happens locally.
Frequently asked questions
How do I install it if there is nothing to drag?
Why does my bookmarklet do nothing?
Can I use multi-line code?
Related Tools
SMS Link Builder
Builds sms: links with phone number and optional message body, ready for mobile apps and pages.
Discord Invite Builder
Builds Discord invite URLs (discord.gg/CODE) from a valid invite code.
Tel Link Builder
Build clickable tel: links from a phone number in the international E.164 format. Great for call buttons on mobile sites, email signatures and contact pages.
Spotify URI Builder
Builds spotify: URIs and https://open.spotify.com URLs from a type (track/album/playlist) and ID.
YouTube Embed Builder
Builds a YouTube embed <iframe> from the video ID with customizable width and height.
UTM URL Builder
Add utm_source, utm_medium, utm_campaign, utm_term and utm_content to a URL. Ready for Google Analytics and GA4. Everything in your browser.