← Back to TechDriven Tools Hire developers →

Published · Updated · 2 min read · By TechDriven Tools editorial team · Developer Tools

How to Encode and Decode Base64

Encode Hello as SGVsbG8=, verify a UTF-8 text round trip and distinguish Base64, Base64URL, data URLs and encryption.

How to Encode and Decode Base64

Base64 Encoder/Decoder represents text bytes with a limited character alphabet. It is an encoding, not encryption: anyone with the encoded value can try to decode it.

Verify a round trip

  1. Choose the encode operation.
  2. Enter exactly Hello, without a trailing newline, and run it.
  3. The standard Base64 result is SGVsbG8=.
  4. Decode that value and compare the result with the original five letters.

A newline changes the bytes and therefore the encoding. This site's text workflow uses UTF-8, so non-ASCII text must be encoded as bytes before Base64 conversion. The Base64 specification distinguishes standard Base64 from its URL-safe alphabet.

Choose the appropriate representation

A Base64 string is not automatically a data URL. A data URL has a prefix describing its media type and encoding; an API field may expect only the payload. Read the receiving field's requirements rather than adding or removing prefixes by guesswork. JWT segments use Base64URL and belong in the JWT Decoder workflow.

Check errors instead of replacing characters blindly

Malformed Base64 or bytes that are not valid UTF-8 can fail in a text decoder. Binary files are not necessarily text, so a valid binary encoding does not promise readable output. Use the relevant file-oriented operation when the source is a file.

Do not Base64-encode passwords or tokens to make them “safe” for sharing. Use a harmless test string when reporting a problem and keep the original byte sequence for comparison.

Ready to try it? Use Base64 Encoder/Decoder free, right in your browser — no upload, no account.

Available tools in this category: Password Generator · UUID Generator · Hash Generator · JSON Formatter · JWT Decoder

← More guides · All tools