Base64 Decode and Encode Online

Decode Base64 to readable text or encode text and files to Base64 in your browser. Supports UTF-8, Base64URL, line-by-line conversion, and Data URL output.

Optional: convert a local file to Base64
Local conversionText and file data are processed by your browser, not uploaded to a server.
UTF-8 safeUnicode text, emoji, Chinese, Japanese, and other non-ASCII characters are handled correctly.
Text and filesDecode strings, encode plain text, or convert a local file into a Base64 or Data URL value.

What is Base64 Decode and Encode?

Base64 is a binary-to-text encoding that represents bytes with printable ASCII characters. It is used when binary data must travel through text-oriented formats such as JSON, HTML, CSS, email, HTTP headers, Basic Auth, JWT parts, and Data URLs.

How to Use This Base64 Decoder and Encoder

  1. Choose Decode when you want to turn Base64 back into text, or Encode when you want to convert plain text to Base64.
  2. Paste a Base64 string, Base64URL value, Data URL, JSON payload, or normal UTF-8 text into the input area.
  3. Turn on line-by-line mode when you have multiple values, or choose a local file to create a Base64 file payload.
  4. Copy the output for use in API requests, HTML/CSS Data URLs, configuration files, tests, or debugging notes.

Common Base64 Use Cases

  • Embedding Small Icons in CSS/HTML:Convert small images or SVGs into Base64-encoded Data URIs, allowing direct embedding in front-end code to reduce HTTP requests.
  • Safe Data Transmission:Encode non-ASCII characters or binary data in network protocols, email headers (MIME), or API calls to ensure integrity.
  • Simple Obfuscation:Obfuscate plaintext configuration files or tokens to prevent immediate readability by casual onlookers.
  • API Testing and Debugging:Quickly encode authentication payloads (like Basic Auth headers) or format binary data for API integration.

Why Choose Our Tool?

  • Decode-first workflow for the most common search intent: checking what a Base64 string contains.
  • Full UTF-8 support to prevent garbled output for multilingual text and emoji.
  • Client-side conversion for text and files, with no server upload for the conversion itself.
  • Practical options for Base64URL tokens, Data URLs, multi-line inputs, and copy-friendly output.

Base64 Options Explained

Base64 vs Base64URL

Standard Base64 uses + and /, while Base64URL uses - and _ so the value can be placed inside URLs without extra escaping.

UTF-8 text decoding

The converter reads decoded bytes as UTF-8 text. This avoids broken output when the original text contains non-English characters.

Data URL output

A Data URL combines a MIME type and Base64 payload. It is useful for embedding small images, fonts, or files directly in HTML, CSS, or JSON.

Line-by-line conversion

Use line-by-line mode for logs, token lists, exported IDs, or CSV-like data where every line should be decoded or encoded independently.

Base64 Examples

Text

Hello, Base64! -> SGVsbG8sIEJhc2U2NCE=

Basic Auth header

username:password -> dXNlcm5hbWU6cGFzc3dvcmQ=

Base64URL token part

eyJhbGciOiJIUzI1NiJ9 -> alg=HS256

Base64 Debugging Checklist

Missing padding

JWTs, OAuth tokens, and URL-safe payloads often remove trailing = characters. This decoder restores padding when possible, but unreadable output can still mean the original bytes were not UTF-8 text.

URL-safe alphabet

If a value contains - or _, it probably uses Base64URL. Decode mode accepts both alphabets, and Encode mode can output URL-safe text without padding.

Data URL prefix

For HTML, CSS, or JSON embedding you may need the full data:mime/type;base64, prefix. For APIs that expect only the payload, remove the prefix before sending.

Sensitive tokens

Base64 decoding a token can reveal headers or payload data, but it does not verify signatures or decrypt secrets. Avoid pasting production credentials unless you control the environment.

Frequently Asked Questions

What is Base64 Encoding?

Base64 is a group of binary-to-text encoding schemes that represent binary data in an ASCII string format. It is commonly used to encode data that needs to be stored and transferred over media that are designed to deal with textual data.

Why is Base64 used?

Base64 is used to prevent data corruption when transferring binary data through systems that may not handle certain bit sequences (like images in HTML or email attachments).

How does Base64 encoding work?

Base64 encoding takes binary data and maps it to a set of 64 printable characters, including A-Z, a-z, 0-9, +, and /. Each character represents 6 bits of data.

Is Base64 the same as encryption?

No, Base64 is not encryption. It is merely a data encoding format and can be easily decoded by anyone. It should not be used for security or protecting sensitive information.

What is Base64URL?

Base64URL is a URL-safe variant that replaces + with -, replaces / with _, and often removes padding. It is commonly used in JWTs, OAuth tokens, and URL parameters.

Why do Base64 strings end with = or ==?

The equals signs are padding. They make the encoded output length a multiple of four characters. Some URL-safe systems omit padding, so this decoder restores it automatically when possible.

Can I convert files to Base64?

Yes. Choose a local file and the browser will read it as Base64. Enable the Data URL option if you need the full data:image or data:application prefix for HTML, CSS, or JSON.

Is this Base64 tool private?

Conversion runs client-side in your browser. Avoid pasting production secrets into any online tool unless you fully trust the environment and understand the risk.