Reddit Base64 Decoder

Userscript that automatically detects and decodes Base64 strings on Reddit, replacing them with readable content.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

Аўтар
rpmn0ise
Усталяванняў за дзень
2
Усяго ўсталяванняў
4
Рэйтынг
0 0 0
Версія
1.0
Створаны
18.04.2026
Абноўлены
18.04.2026
Памер
2.6 КБ
Ліцэнзія
MIT
Ужываецца на

Reddit Base64 Decoder

Userscript that automatically detects and decodes Base64 strings on Reddit, replacing them with readable content.


Features

  • Automatic detection of Base64 strings in posts and comments
  • Real-time decoding
  • Direct replacement of encoded text
  • Converts decoded URLs into clickable links
  • Handles dynamic content via MutationObserver

Example

Before:

aHR0cHM6Ly9tb2RzZmlyZS5jb20vOXRlOFc3NTRMdWs3Q0JU

After:

https://modsfire.com/9te8W754Luk7CBT

→ Automatically clickable


Installation

Just click the "Install this script" button.


How it works

  • Scans the DOM using TreeWalker
  • Detects Base64 strings via regex
  • Decodes using atob()
  • Replaces text with:

    • <a> element if it’s a URL
    • plain text otherwise
  • Observes DOM changes with MutationObserver


Technical Notes

  • Base64 detection regex:

```js id="ex3" /\b[A-Za-z0-9+/]{20,}={0,2}\b/g


* URL detection:

```js id="ex4"
/^https?:\/\/[^\s]+$/
  • UTF-8 handling:

```js id="ex5" decodeURIComponent(escape(atob(str)))


---

## Limitations

* Possible false positives (strings matching Base64 pattern)
* Decoded output may be unreadable (binary data)
* Depends on Reddit’s DOM structure
* May reprocess dynamically loaded nodes

---

## Improvements (TODO)

* Better false-positive filtering
* Optional UI (tooltip / toggle)
* Multi-site support
* Performance optimization (avoid redundant scans)
* Replace legacy UTF-8 handling with `TextDecoder`