Base64URL Encoder (URL-Safe Base64)

Encode text to URL-safe Base64 (Base64URL) with - and _ instead of + and /, and no padding. The format used in JWTs and URLs.

Part of the free Base64 Encoder. Runs in your browser — nothing is uploaded.

Base64URL Encoder (URL-Safe Base64)

Standard Base64 uses + and /, which have special meaning in URLs. Base64URL swaps them for - and _ and drops the = padding. It is the encoding used inside JSON Web Tokens and many web APIs.

Worked example: Standard vs URL-safe output

Text

>>>???~~~

Both encodings

standard: Pj4+Pz8/fn5+
url-safe: Pj4-Pz8_fn5-

Practical tip

When decoding Base64URL with a standard decoder, first replace - with + and _ with /, then add = padding until the length is a multiple of 4.

How to use this Base64 Encoder

  1. 1Use the live tool above — it runs entirely in your browser and never uploads your data.
  2. 2Paste the sample from the worked example, or use your own input.
  3. 3Copy the result, then adapt the same steps in your editor, script, or pipeline.

Base64URL Encoder (URL-Safe Base64) FAQs

What is the difference between Base64 and Base64URL?

Base64URL uses - and _ instead of + and /, and usually omits padding. That makes it safe in URLs and filenames without percent-encoding.

Which encoding do JWTs use?

JWTs use Base64URL without padding for the header, payload and signature segments.

More Base64 Encoder pages

Open the full Base64 Encoder tool →