Base64 Decode on Selection
Free to download on every platform. Comes pre-installed on BotFone, BotPad and BotFlip — with extra free apps included.
About this app
WHAT IT DOES
This script adds a floating button that appears when you select text, allowing you to instantly decode Base64-encoded content or encode plain text to Base64. Click the button to decode the selected text—the result appears in a popup with the detected encoding (UTF-8 or ASCII). You can copy the decoded text, replace the original selection with the decoded result, or encode the selected text instead. The script supports both decoding and encoding, with auto-detection that tries decoding first and falls back to encoding if the selection isn't valid Base64. Keyboard shortcuts (Ctrl+Shift+D for decode, Ctrl+Shift+E for encode) provide quick access.
WHERE IT RUNS
The script works on any page with selectable text—API responses, logs, configuration files, documentation, chat messages, and any page containing Base64-encoded data. It works on any website, adding a lightweight tool for quick Base64 operations without leaving your page.
HOW TO USE
After installation, select any text on a page. A floating 🔓 button appears near your selection. Click it to decode the selected text—the result appears in a popup. From the popup, you can copy the result to your clipboard, replace the original selection with the decoded text, or encode the selection to Base64. Use keyboard shortcuts: Ctrl+Shift+D to decode, Ctrl+Shift+E to encode. Open the panel to customize settings: show/hide the floating button, choose button position (top-right, top-left, bottom-right, bottom-left), toggle the decoded popup, enable auto-detect (decode/encode fallback), show the encode option, and enable replace-on-decode.
TECHNICAL MECHANISM
The script uses a multi-stage Base64 processing pipeline. First, it captures text selection using the Selection API, detecting when the user selects text and determining the selection's bounding rectangle for button positioning. Second, it validates Base64 encoding using a regex pattern that checks for valid characters (A-Za-z0-9+/=) and length (multiple of 4). Third, it decodes using `atob()` with UTF-8 detection via TextDecoder—it attempts UTF-8 decoding first and falls back to ASCII if invalid byte sequences are detected. Fourth, it encodes using `btoa()` with UTF-8 preprocessing via TextEncoder. Fifth, it displays results in a floating popup with copy, replace, and encode actions. The script uses position tracking to place the button and popup near the selection, and click-outside handlers to dismiss the popup.
THE PANEL
The settings panel is fully draggable and can be positioned anywhere on your screen. It automatically snaps to the nearest edge when released, keeping your workspace organized. The panel can be collapsed to a small bubble showing only a gear icon, and restored with a single click. Its position is remembered across page reloads using GM_setValue. The panel also responds to the Escape key, which instantly hides it until you click the bubble again. All settings are saved immediately when changed and persist across browser sessions.
PLEASE NOTE
This script requires the free BotGentz extension to run. Base64 decoding is performed using the browser's built-in `atob()` and `btoa()` functions. Large selections may affect performance. The script does not access, store, or transmit any personal data or browsing history. All processing happens locally in your browser and never leaves your device.