Skip to main content

Base64 encoder and decoder

Convert text to Base64 or decode a Base64 value to restore readable content directly in your browser.

  • Clipboard
  • Export
Automate

Embed this widget

Customize the result, check the live preview, then copy the code.

Preview

Embed code type

Code to copy

Responsive and automatically resized by Bethemesh.

Was this tool useful?

How does this tool work?

Base64 represents bytes using ASCII characters so they can travel through a text field. This tool converts your text to UTF-8 before encoding it, or recovers UTF-8 text from a Base64 string. Use it for short JSON payloads, messages and integration checks. Processing takes place in your browser. It does not restore an image as a downloadable image file, and it does not protect a secret: anyone with the encoded string can reverse the operation.

Encoding uses the standard Base64 alphabet, including + and /, with = padding at the end when required. Three bytes become four characters. Long inputs therefore grow by roughly a third; for accented characters and emoji, count UTF-8 bytes rather than visible characters. Base64 is not compression and will not make a text payload smaller.

Decoding rebuilds the bytes and then requires valid UTF-8 text. A perfectly valid Base64 string may contain binary data; in that case the tool reports an error instead of silently replacing unreadable bytes. An initial byte order mark is preserved. There is no setting for Latin-1, Windows-1252 or another legacy text encoding.

The browser accepts ASCII whitespace and line breaks in the encoded input, and allows some omitted padding. This is not a strict canonical RFC 4648 validator. Base64url, which uses - and _, is unsupported. Do not include a data: prefix or paste a complete JWT: those formats have additional structure and need a different reader.

How to use this tool

  1. Choose the exact input

    Paste plain text for encoding, or just the Base64 string for decoding. Spaces in the original plain text are part of the payload and will be encoded.

  2. Select the direction

    Click Encode or Decode. Editing the input hides the previous result; run the action again to produce output for the changed content.

  3. Reuse the result

    Copy or download the output. Prefer a download when decoded text contains CR or CRLF line endings: the displayed textarea normalizes how those line breaks appear.

Use cases

Inspect an API value

Decode a field documented as UTF-8 text in Base64, then use the JSON formatter if the recovered content is a JSON document.

Prepare a test fixture

Encode a short string containing an accented character to check that your application transports UTF-8 bytes and restores the same text at the other end.

Prepare a text field

Transport a small UTF-8 value through a contract explicitly requiring Base64, then verify recovery at the destination.

Examples

Encode ASCII text

Input

Hello

Result

SGVsbG8=

Recover an accented character

Input

w6k=

Result

é

Tips and best practices

  • Keep the original text separate from its encoded representation. Encoding twice changes the string without adding protection.
  • Use the image Base64 converter for images, or the URL encoder for a URL component; the intended destination determines the right operation.
  • If output starts with a BOM, retain it only when appropriate for the receiving format; decoding preserves that marker.

Sources and references

Frequently asked questions

Why can valid Base64 be rejected?

Its bytes may represent an image, an archive or text in a different encoding. This decoder requires UTF-8 text and does not restore binary files.

Can I decode JWT segments here?

JWT uses Base64url and separates segments with dots. Use the JWT decoder for that format; a whole token is not suitable input here.

What are the trailing = characters for?

They pad the final group when the byte count is not divisible by three. The standard encoder adds them whenever needed.

Is Base64 suitable for storing a password?

No. Anyone can reverse the representation without a key. Password storage requires a dedicated method; encoding does not make a value confidential.

Recommended workflow

Discover tools that naturally fit before, after, or alongside this one.

Works well with

Decode a JWT to read its header, payload, claims and expiration dates.

DevelopmentFeaturedUse this tool

Compute MD5, SHA-1, SHA-256, SHA-384 and SHA-512 hashes of a text or file in one go.

DevelopmentFeaturedUse this tool

Format, minify, and validate JSON to make it easier to read or more compact.

DevelopmentFeaturedUse this tool

Alternatives

Encode or decode a URL, its parameters, and any special characters it contains.

DevelopmentUse this tool

Use before

Remove extra spaces, repeated tabs and empty lines from copied text.

DevelopmentFeaturedUse this tool

Next step

Format, minify, and validate JSON to make it easier to read or more compact.

DevelopmentFeaturedUse this tool