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.
Cómo usar Base64
- 1
Enter your text or Base64 string
Paste plain text to encode or a Base64 string to decode.
- 2
Click Encode or Decode
The result appears instantly in the output panel.
- 3
Copy result
Click the copy button to use the result.
Preguntas frecuentes
Is my data safe?
What character encoding is used?
Why does my Base64 string end with == or =?
What is the difference between Base64 and Base64url?
Can I encode binary files with this tool?
Saber más
¿Qué es 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 qué 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.
Consejos y buenas prácticas
- 💡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.
Cómo 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.