Base64 Decode & Encode — Free Online Base64 Tool

100% Private - Processed Locally
Options

Input String

Drop file to load

Processed locally in browser

0 lines0 chars
Offline· no network access
Output String
0 KB0ms

What is the Base64 Encoder & Decoder?

Decode Base64 strings or encode text to Base64 instantly — this free browser-based tool converts plain text or binary data into Base64-encoded ASCII strings, and decodes Base64 strings back into their original form, all inside your browser without sending any data to a server. It is an essential utility for developers who work with HTTP authentication, JWT tokens, data URLs, email protocols, and API integrations that use Base64 encoding as a data transport mechanism.

Base64 is not encryption — it is an encoding scheme that converts arbitrary binary data into a set of 64 printable ASCII characters, making the data safe to include in text-based protocols like HTTP headers, JSON payloads, and URLs. The encoding is completely reversible and standardized. It is used everywhere: the Authorization: Basic HTTP header, JWT token segments, embedded image data URLs in CSS, MIME email attachments, and SSH key file formats all rely on Base64.

Because Base64 strings frequently contain sensitive values — authentication credentials, decoded JWT payloads, API keys, and session tokens — it is critical to decode them locally rather than submitting them to an online service that may log your input. This tool uses the browser’s built-in btoa() and atob() native functions, which run entirely in your browser’s sandboxed JavaScript engine with no network access required.

How to Use the Base64 Encoder & Decoder

  1. Select your mode using the options bar above the editor. Choose Encode → Base64 to convert plain text into a Base64 string, or Decode ← Base64 to convert a Base64 string back into plain text.
  2. Paste your input into the left panel. For encoding, paste the raw text you want to convert — for example, username:password for a Basic Authentication header. For decoding, paste the Base64 string you want to read.
  3. The output appears instantly in the right panel. There is no button to click — the transformation happens as you type or paste. The result is the encoded or decoded string ready to copy.
  4. Copy the output using the Copy button. Paste it directly into your HTTP header, your source code, your API test tool, or wherever you need the encoded or decoded value.
  5. For JWT tokens: Base64 is used in all three segments of a JWT, separated by periods. Use our dedicated JWT Decoder tool, which splits the token automatically and decodes each segment correctly, including the Base64Url variant used by JWTs.

Common Use Cases

HTTP Basic Authentication headers: The HTTP Basic Auth scheme requires credentials as username:password, encoded as Base64, in the Authorization: Basic <token> header. When building or testing API integrations, paste your credentials string here, encode it, and copy the output directly into your request header — without any server handling your credentials.

Decoding JWT payload segments: JSON Web Tokens consist of three Base64Url-encoded segments separated by periods. The middle segment contains the claims — user ID, role, expiry time, and custom attributes. While our JWT Decoder tool handles the full token, you can manually paste just the payload segment here (in decode mode) to quickly read its contents when debugging authentication issues.

Embedding images as data URLs: Frontend developers sometimes embed small images directly into CSS using data URLs (e.g., background-image: url('data:image/png;base64,...')). Paste a Base64-encoded image string here to verify it decodes to the correct binary content before embedding it in your stylesheet.

Debugging API integrations: Some APIs encode request or response payloads in Base64, particularly when transmitting binary data through a JSON field. When debugging these integrations, decoding the Base64 field value here gives you the raw content to inspect and validate against expected values.

Reading encoded Kubernetes secrets: Kubernetes secrets store all values Base64-encoded in YAML manifests. When reviewing or auditing configuration, paste the encoded values here to decode them without needing a kubectl client or command line access.

How Browser-Only Processing Works for This Tool

This tool uses two native browser JavaScript functions:

  • btoa(string) — “binary to ASCII” — returns the Base64-encoded representation of a string
  • atob(string) — “ASCII to binary” — decodes a Base64 string back to its original

These are built-in browser APIs implemented in the browser’s C++ runtime. They make no network calls, depend on no external library, and run entirely within the browser’s sandboxed execution environment. The input is passed to the function, the output is returned, and the result is written to the output panel. Nothing else happens.

You can verify this by opening DevTools (F12), going to the Network tab, and pasting a value to encode or decode. You will see zero outbound network requests carrying your data — the operation is equivalent to running btoa() or atob() directly in your browser console.

Example Input (Encode)

Hello World!

Example Output (Encode)

SGVsbG8gV29ybGQh

Why use this offline converter?

Base64 often contains sensitive tokens, credentials, or private data. Because this converter is 100% browser-based, your data never leaves your machine. It offers the speed and convenience of an online tool with the security of a local script.

Frequently Asked Questions

Is it safe to decode sensitive Base64 strings here?

Absolutely. The tool relies entirely on the btoa() and atob() native browser APIs — there is no server involved, no data transmission, and no logging of any kind. Your Base64 strings never leave your browser's memory. This makes it perfectly safe to decode API keys, authentication headers, JWT segments, and other sensitive encoded strings.

Can it encode files to Base64?

Currently, this tool is optimized for plain text string encoding and decoding. File-to-Base64 encoding (for embedding images in CSS or generating data URLs) will be added in a future update. For now, if you need to encode a file, you can copy its text content and paste it here to encode it as a Base64 string.

What is Base64 encoding used for?

Base64 is used to encode binary or text data into a format safe to transmit over text-based protocols. Common uses include encoding credentials in HTTP Basic Authentication headers, embedding small images as data URLs in CSS or HTML, encoding binary data in JSON payloads, and transmitting email attachments via SMTP. JWT tokens also use a URL-safe Base64 variant for their header and payload segments.

What is the difference between Base64 and Base64Url?

Standard Base64 uses + and / as characters 62 and 63, and includes = padding. Base64Url replaces + with - and / with _, and omits padding. This makes Base64Url safe to include in URLs without percent-encoding. JWT tokens use Base64Url for their header and payload. If you're decoding a JWT segment manually, you may need to restore + and / before standard Base64 decoding works — or use our dedicated JWT Decoder tool instead.

How do I encode a password or API key in Base64?

Select Encode mode, paste your plain text value (for example, username:password for a Basic Auth header) into the input panel, and the encoded Base64 string appears instantly in the output panel. Copy and use it wherever your protocol requires Base64 encoding. Remember: Base64 is encoding, not encryption. Anyone with the Base64 string can decode it instantly — it provides no security on its own.

Why does my decoded Base64 string look like garbled text?

This usually means the Base64 string encodes binary data (like an image, a compressed file, or a binary serialized object) rather than plain text. Base64 can encode any binary data, but this tool displays the output as a UTF-8 text string. If the original data was binary, the decoded text will contain non-printable characters and appear garbled. For binary data, you need a tool that outputs raw bytes.