Skip to main content

Developer Tools

Base64 Encode / Decode

Convert plain text and Base64 in either direction.

Base64 Encode / Decode tool

Loading tool…

Jump to a section

About This Tool

Convert UTF-8 text to Base64 for transport, or decode Base64 back into readable text. The tool supports standard Base64 and the URL-safe variant used in JWT segments, query parameters, filenames, and web APIs, with conversion handled locally in your browser.

How To Use It

  1. Choose Encode or Decode.
  2. Select Standard Base64 or URL-safe Base64.
  3. Enter the text to encode, or paste the Base64 value to decode. Whitespace in pasted Base64 is ignored.
  4. Check the output byte count when size matters for a header, token, payload, or storage field.
  5. Copy the result, or use the output as the next input to reverse-check the conversion.

Examples

Encode text

Hanakash becomes SGFuYWthc2g= in standard Base64. Unicode text is encoded as UTF-8 bytes before Base64 conversion.

Decode a token segment

Switch to URL-safe Base64 when a value uses - and _ instead of + and /, or when padding is omitted.

Clean up pasted Base64

Line breaks or spaces from emails, logs, and wrapped terminal output are removed before decoding, so formatted Base64 can still be inspected.

Useful Notes

What Base64 is for

Base64 represents bytes as text characters that are easier to move through systems that expect text, such as JSON, headers, or form fields.

Not encryption

Base64 is reversible encoding, not a security layer. Do not treat a Base64 value as secret simply because it looks unreadable.

Standard versus URL-safe

Standard Base64 uses +, /, and optional = padding. URL-safe Base64 replaces + with - and / with _, and often omits trailing padding so the value can travel more safely in URLs and token segments.

Text, not arbitrary files

This page is designed for UTF-8 text input and output. Encoding rejects unpaired Unicode surrogate characters rather than silently replacing them, while valid emoji and other Unicode characters are preserved. Decoded bytes that are not valid UTF-8 produce an error instead of replacement characters, even when the Base64 itself is valid. A leading byte-order mark is preserved as part of the text. Use a file decoder for arbitrary binary data.

Local processing and sensitive values

Encoding and decoding happen in browser JavaScript without an API request. Input is limited to 500,000 characters to keep the multiple conversion buffers responsive. Base64 text can contain passwords, API keys, session data, or personal information, so use test data when possible and clear sensitive values when you are done.

FAQ

What is URL-safe Base64?

URL-safe Base64 replaces + with - and / with _, and often removes trailing = padding so the value can fit more easily in URLs.

Does Base64 hide or protect data?

No. Base64 is easy to reverse and should not be used as encryption, hashing, redaction, or access control.

Why does decoding fail?

The input may contain invalid Base64 characters, use the wrong variant, be truncated, or decode to bytes that are not valid readable UTF-8 text.

Is conversion local?

Yes. Encoding and decoding use browser APIs on the page; the tool does not need to upload the input to perform the conversion.

Can I decode a JWT with this?

You can decode an individual Base64URL segment, but the JWT Decoder is better for complete tokens because it separates the header, payload, signature segment, and time claims.