1. Home
  2. Developer tools
  3. Base64URL Encoder

Base64URL Encoder

Base64URL swaps + and / for - and _ and normally drops the = padding, so the result can sit in a URL, a cookie or a file name unescaped. It is the encoding inside every JSON Web Token.

Free, no sign-up. Runs in your browser: nothing is uploaded.

How to use Base64URL Encoder

  1. Choose encode or decode.
  2. Paste text, hex bytes or a Base64 or Base64URL string.
  3. Copy the result, with or without padding.

Features

  • Encode text or bytes to Base64URL
  • Decode with or without padding
  • Convert standard Base64 to Base64URL and back
  • UTF-8 text handled correctly
  • Shows byte count and padding removed
  • Reports characters that do not belong in the alphabet

Supported formats

Input

  • Typed or pasted text

You get

  • Base64URL

Private by design

Everything you enter is processed by your browser on this device. Nothing is sent to openWorkstand or anyone else, so the Base64URL Encoder is safe for private and work data. After you have used it once while online, it also works without an internet connection. How local processing works

Good to know

  • Base64URL is an encoding, not encryption.
  • Decoding a token part shows its text but does not verify any signature.

Guide

Base64URL: Base64 that survives URLs, cookies and tokens

Ordinary Base64 has two problems when it travels in web addresses and similar places. Its alphabet includes + and /, which URLs treat as a space and a path separator, and it ends with one or two = signs, which separate names from values in query strings. Base64URL is the small variant that fixes both, and it is the encoding inside JSON Web Tokens, many signed cookies and a good deal of modern API plumbing.

What changes

The alphabet is the same sixty-four characters apart from two: the character for value 62 is - instead of +, and the one for value 63 is _ instead of /. The grouping is identical, three bytes into four characters, and the output is the same length. Padding is optional in the standard and is usually dropped, because the length of the encoded text already tells a decoder how many bytes the last group holds.

Why padding can go

Without padding, an encoded string has a length that leaves 0, 2 or 3 characters in the last group, which stand for 3, 1 or 2 bytes. A length that leaves 1 is impossible. A decoder can restore the missing = signs from the length, which is what the one on this page does. The “Keep = padding” switch writes them on output for systems that insist.

Using the page

Choose encode or decode, and say whether the input is text (UTF-8) or hexadecimal bytes. The decoder accepts either alphabet, so a string copied from a standard Base64 source decodes too, and re-encoding it gives the URL-safe form. That makes the page a quick way to convert between the two. The output shows the byte and character counts, and a character outside both alphabets is reported with its position.

In JSON Web Tokens

A JWT has three parts separated by dots: a header, a payload and a signature, each in Base64URL. The first two are JSON documents, so decoding them as text shows the algorithm, the claims and the expiry. The page decodes them, but it does not check that the signature is valid, and it should not be used to decide whether a token can be trusted. The JWT decoder tool presents all three parts together and describes standard claims.

A worked example

The Sample button loads the text subjects?_d=1&filter=a/b+c, which is 26 bytes. Ordinary Base64 of it would include characters that need escaping in a URL. The Base64URL encoding is c3ViamVjdHM_X2Q9MSZmaWx0ZXI9YS9iK2M, 35 characters with no padding needed. The underscore in it stands for the value 63, the one that standard Base64 writes as a slash. A shorter test is the text ???>>>, whose standard encoding is Pz8/Pj4+ and whose Base64URL form is Pz8_Pj4-.

Limits

Base64URL is an encoding. It does not hide, compress or protect the data, and anyone can decode a token’s payload. The page treats whatever you paste as a single block; it does not split tokens, check signatures, or validate that the decoded text is JSON. If the decoded bytes are not valid UTF-8 text, switch to hexadecimal output. Very large inputs are fine but are slower to render.

Checked against the current version of the Base64URL Encoder on .

Frequently asked questions

What goes wrong if I put ordinary Base64 into a URL?

The plus sign is read as a space in a query string, the slash splits the path, and the equals sign separates parameter names from values. The value then arrives changed or truncated. Base64URL avoids all three problems by using - and _ and dropping the padding.

How do I decode one part of a JWT?

Take the text between two dots, paste it in the decoder, and choose text output. The first part is the header and the second the payload, both JSON. The third part is a signature, which is raw bytes and will look like noise as text.

Can I decode a JWT part here?

Yes, paste the header or payload between the dots and decode it as text. To read a whole token with its claims and expiry, use the JWT Decoder.

Why is the padding dropped?

The length already tells a decoder how many bytes the last group holds, and the = sign would have to be percent-encoded in URLs and query strings.

Keep working with the result

openWorkstand also includes a free workspace with documents, spreadsheets, tasks, projects and a calendar that save to a folder on your computer.