Use this before decoding :

var decode = function(input) {
        // Replace non-url compatible chars with base64 standard chars
        input = input
            .replace(/-/g, '+')
            .replace(/_/g, '/');

        // Pad out with standard base64 required padding characters
        var pad = input.length % 4;
        if(pad) {
          if(pad === 1) {
            throw new Error('InvalidLengthError: Input base64url string is the wrong length to determine padding');
          }
          input += new Array(5-pad).join('=');
        }

        return input;
    }

After using this function you can use any base64 decoder

Answer from mohamad on Stack Overflow
๐ŸŒ
Base64 Decode
base64decode.org
Base64 Decode and Encode - Online
For example, MIME's Base64 ... but differ in the symbols chosen for the last two values; an example is the URL and filename safe "RFC 4648 / Base64URL" variant, which uses "-" and "_"....
People also ask

What Is the Difference Between Base64 and Base64URL?
Base64URL is a version of Base64 designed for URLs and token formats. It replaces the characters + with - and / with _, and padding characters (=) are often removed for URL safety. This format is commonly used in JWTs, OAuth tokens, and OpenID Connect. Want a deeper walkthrough of how Base64 works and when to use it? Read our Base64 encode & decode guide.
๐ŸŒ
authgear.com
authgear.com โ€บ tools โ€บ base64-decode-encode
Base64 Decode and Encode | Authgear
What Is Base64 Encoding?
Base64 is a binary to text encoding format that represents binary data using ASCII characters. It allows binary content to be included safely inside formats such as JSON, XML, or HTTP headers. Example: Authgear โ†’ QXV0aGdlYXI=
๐ŸŒ
authgear.com
authgear.com โ€บ tools โ€บ base64-decode-encode
Base64 Decode and Encode | Authgear
๐ŸŒ
URL Decode
urldecoder.org โ€บ dec โ€บ base64url
URL Decoding of "base64url" - Online
Decode base64url from URL-encoded format with various advanced options. Our site has an easy to use online tool to convert your data.
๐ŸŒ
Toolsaday
toolsaday.com โ€บ encode-decode โ€บ base64Url-decode
Base64Url Decode Online | Toolsaday
Decode Base64 url safe to plain text. We provide a free tool that decode base64 url to plain text.
๐ŸŒ
SimplyCalc
simplycalc.com โ€บ base64-decode.php
(SimplyCalc) base64 / base64url decoder
Decode base64 and base64url encoded text, as per RFC-4648. Input data is assumed to be a base64 or base64url encoded UTF-8 string. See corresponding JavaScript source code.
Find elsewhere
๐ŸŒ
Base85 Encoder
rfctools.com โ€บ base64url-decoder
Base64url Decoder
With this tool you can convert data encoded using the Base64url encoding scheme to its original format
๐ŸŒ
Authgear
authgear.com โ€บ tools โ€บ base64-decode-encode
Base64 Decode and Encode | Authgear
Decode Base64 to text or encode text to Base64 instantly, 100% in your browser. Base64URL for JWTs, UTF-8, UTF-16, ASCII. Free, open source, nothing uploaded.
๐ŸŒ
Online Tools
emn178.github.io โ€บ online-tools โ€บ base64_decode.html
Base64 Decode - Online Tools
Decode standard Base64, Base64URL, unpadded, IMAP-style, or custom-alphabet data to text or binary bytes online.
๐ŸŒ
MDN Web Docs
developer.mozilla.org โ€บ en-US โ€บ docs โ€บ Glossary โ€บ Base64
Base64 - Glossary | MDN
Browsers also natively provide two JavaScript functions for decoding and encoding Base64 strings:
๐ŸŒ
GitHub
github.com โ€บ jpfleury โ€บ base64url
GitHub - jpfleury/base64url: Bash encoder/decoder for the base64url format ยท GitHub
base64url can now be invoked directly from the terminal. It supports encoding, decoding, and format conversions between base64 and base64url.
Author: jpfleury
๐ŸŒ
Base64.Guru
base64.guru โ€บ home โ€บ base64 standards โ€บ base64url
Base64URL Encode | Base64URL | Base64 Standards | Base64
Base64URL Encode is a free online ... text, uploading a file, or specifying a URL. If you want to decode Base64URL string to original data, check the Base64URL Decoder....
๐ŸŒ
Oster Miller
ostermiller.org โ€บ calc โ€บ encode.html
Base64 and URL Encoding and Decoding
Encodes or decodes data in Base64 or URL encoding using client side JavaScript
๐ŸŒ
Cryptii
cryptii.com โ€บ pipes โ€บ base64-to-hex
Base64 to hex: Encode and decode bytes online - cryptii
Base64 encoding schemes are used when binary data needs to be stored or transferred as textual data. Therefore 64 characters are chosen that are both members of a subset common to most encodings (ASCII), and also printable.
๐ŸŒ
Base64Encode.org
base64encode.org โ€บ enc โ€บ base64url
Base64 Encoding of "base64url" - Online
Perform URL-safe encoding (uses Base64URL format). ENCODE ... Please wait until the encoding process is complete. ... Please note that this file is removed from our system immediately after the first download attempt or 15 minutes of inactivity. ... Need this tool again? Bookmark this page for instant access next time. Meet Base64 Decode and Encode, a simple online tool that does exactly what it says: decodes from Base64 encoding as well as encodes into it quickly and easily.