Base64, either way
Encode or decode, base64url included, full Unicode handled properly. Nothing leaves the tab.
Encoding is not encryption
This is worth stating plainly because it is the source of genuine security incidents. Base64 has no key and no secret. Anything encoded is decodable by anyone, instantly, on a page like this one. It obscures a value from a casual glance and from nothing else.
Credentials stored base64-encoded in a config file, a database column or an environment variable are stored in plain text with extra steps. If you have found one, treat it as exposed.
Unicode, done properly
The naive browser implementation — btoa() on a string — throws on any character outside Latin-1, which means most emoji, most non-English text and even a typographic dash. The correct approach encodes the text to UTF-8 bytes first and base64s those. That is what this page does, so accented characters, CJK text and emoji all survive a round trip. The example button demonstrates it.