início/dev/base64

Base64 Encoder & Decoder Online

Encode & decode Base64 strings

Use Case

Base64 is essential for embedding binary data (like small icons) directly into CSS or HTML as Data URIs, saving extra HTTP requests.

Como usar Base64

  1. 1

    Enter your text or Base64 string

    Paste plain text to encode or a Base64 string to decode.

  2. 2

    Click Encode or Decode

    The result appears instantly in the output panel.

  3. 3

    Copy result

    Click the copy button to use the result.

Perguntas frequentes

Is my data safe?
Yes. All processing happens entirely in your browser. Your data never leaves your device and is never uploaded to any server.
What character encoding is used?
UTF-8 encoding is used by default, which supports all Unicode characters including emoji, accented letters, and non-Latin scripts.
Why does my Base64 string end with == or =?
Base64 output must be a length that is a multiple of 4, so '=' padding characters are added at the end when the input length is not divisible by 3. This is standard and expected — '==' means 2 padding bytes were needed, '=' means 1.
What is the difference between Base64 and Base64url?
Base64url replaces '+' with '-' and '/' with '_', and omits the '=' padding. It is used in JWTs and URL parameters to avoid characters that have special meaning in URLs. This tool handles standard Base64; manually replace the characters if you are working with Base64url.
Can I encode binary files with this tool?
This tool is designed for text (UTF-8) input. For binary files like images, use the Image to Base64 tool which handles binary data correctly via the FileReader API.

Saiba mais

O que é Base64?

Encode plain text or binary data to Base64, or decode Base64 strings back to their original form. Uses UTF-8 encoding for full Unicode character support. Essential for working with APIs that transmit binary data as text, inspecting HTTP Basic Authentication headers, decoding email attachments, and debugging data URIs. All encoding and decoding happens in your browser using JavaScript's built-in atob() and btoa() functions — your data is never sent to any server.

Por que usar Base64?

  • Instant encode/decode — no delay, no page reload. Paste your input and the result appears immediately.
  • Full Unicode support — handles all UTF-8 characters including emoji, accented letters, and CJK characters.
  • Essential for API debugging — HTTP Basic Auth, JWT inspection, and data URIs all involve Base64 encoding.
  • Completely private — your data never leaves your browser. Safe to use with tokens, credentials, and sensitive payloads.
  • No installation — works in any modern browser without plugins or extensions.

Casos de uso de Base64

HTTP Basic Authentication

HTTP Basic Auth sends credentials as Base64-encoded 'username:password'. Decode an Authorization header to inspect or debug the credentials being sent.

JWT inspection

JWT payloads are Base64url-encoded. Decode the middle segment of a JWT to inspect claims without a dedicated JWT tool.

API debugging

Some APIs encode binary responses or request bodies in Base64. Decode to inspect the raw content, or encode binary data before sending a request.

Email attachment headers

MIME email attachments are Base64-encoded. Decode the content of a raw email to extract or inspect embedded attachments.

Dicas e boas práticas

  • 💡Base64url (used in JWTs and URLs) replaces '+' with '-' and '/' with '_'. If you see decoding errors, try replacing these characters before decoding.
  • 💡Base64 always produces output whose length is a multiple of 4, padded with '=' characters. Missing padding can cause decode errors.
  • 💡For image data URIs, use the Image to Base64 tool instead — it generates the full data:image/...;base64, prefix automatically.
  • 💡UTF-8 text encoded to Base64 and back will always be identical to the original as long as the same encoding is used at both ends.

Como funciona

The encoder uses JavaScript's built-in btoa() with a UTF-8 workaround (encodeURIComponent + replace) to support the full Unicode character set. The decoder reverses this with atob() after normalizing any Base64url characters. The browser's native functions implement the IETF RFC 4648 Base64 alphabet. For large inputs, encoding and decoding are synchronous and complete in milliseconds. Binary file encoding (for non-text files) is not supported by this text-focused tool — use the Image to Base64 tool for images.