This online Base64 encoder and decoder converts plain text to Base64 and decodes Base64 strings back to readable text directly in your browser.
Quickly encode text to Base64 or decode Base64 strings with instant copy, paste, download and clipboard support — no server upload required.
Base64 is a binary-to-text encoding scheme that represents arbitrary binary data using a 64-character ASCII alphabet. It converts bytes into a safe, printable string that can be transmitted through channels originally designed for text only, such as email bodies, JSON payloads, XML documents, HTTP headers or URL query parameters.
Base64 is encoding, not encryption — it provides no confidentiality. It simply ensures that binary content survives transport through systems that may otherwise corrupt non-ASCII bytes.
Developers need a reliable Base64 encoder/decoder when inspecting API tokens, decoding JWT header or payload segments, debugging HTTP Basic Authentication strings, generating data URIs for images, or converting binary files into a text-friendly form. A dedicated online tool removes the need to write throwaway scripts or open a terminal just to run btoa/atob.
Our encoder also handles Unicode correctly by UTF-8 encoding text before Base64, which avoids the classic "InvalidCharacterError" you get from calling btoa() directly on non-ASCII strings.
Using this Base64 converter takes only a few seconds:
.txt file. Our Base64 encoder/decoder runs 100% in your browser using the native btoa() and atob() APIs wrapped with UTF-8 safe helpers. There are no uploads, no tracking, no ads and no registration. The interface is built around a Monaco editor for syntax-aware editing, fullscreen mode, and fast handling of long strings.
The tool works equally well for small snippets (API keys, auth headers) and for larger payloads such as JWT tokens, email MIME parts or embedded data URIs.
Base64 groups input bytes into blocks of 3 bytes (24 bits) and splits them into 4 groups of 6 bits. Each 6-bit group (0–63) is mapped to a character in the Base64 alphabet: A–Z, a–z, 0–9, + and /. The result is always a multiple of 4 characters long.
When the input length is not a multiple of 3, the encoder pads the output with one or two = characters so that downstream parsers can recover the original byte length. The URL-safe variant (RFC 4648 §5) replaces + with - and / with _ so the string can safely appear in URLs and filenames.
encoded_text.txt or decoded_text.txt.Base64 encoding shows up almost everywhere in web development and systems integration. Typical scenarios include:
data:image/png;base64,...).username:password for the Authorization header. Yes. This tool performs all encoding and decoding locally in your browser using the native btoa() and atob() APIs. Your text is never uploaded to our servers, there is no telemetry on the input, and no logs are kept of the data you paste.
Still, remember that Base64 is not a security mechanism. Anyone who receives the encoded string can trivially decode it. Never rely on Base64 to hide passwords, API keys or sensitive personal information — use proper encryption or secret management for that.
DevTools is a free, ad-free suite of utilities built by developers for developers. Each tool is designed to load fast, work offline after the first visit, and respect your privacy by running entirely in the browser. The Base64 encoder/decoder is part of a larger family of encoding, formatting and conversion tools that share a consistent UI and keyboard-friendly workflow.
Whether you are debugging an API, crafting an email template, or inspecting a JWT, you can move between DevTools utilities without leaving the tab — no accounts, no rate limits, no upsell.
After encoding or decoding, copy the result to your clipboard or download it as a plain text file. If you need different formats or related conversions, jump directly to one of our companion utilities:
The = characters are padding. Base64 output length must be a multiple of 4, so when the input byte length is not a multiple of 3, one or two = are appended to indicate how many bytes were padded.
URL-safe Base64 (RFC 4648 §5) uses - and _ instead of + and / so the result can be used in URLs, filenames and JWTs without further percent-encoding.
Yes. The encoder UTF-8 encodes your text before calling btoa(), and the decoder reverses that, so arbitrary Unicode input works correctly.
There is no hard limit set by the tool. Practical size is bounded by your browser's memory — strings of several megabytes are handled smoothly on modern machines.
Both represent binary data as text. HEX uses 16 characters and produces output that is 2× the input length; Base64 uses 64 characters and produces output that is ~1.33× the input length, making it more compact for transmission.
All encoding/decoding happens locally in your browser — no data is sent to our servers. That said, Base64 is not encryption. Do not rely on Base64 to protect secrets; use proper cryptography for confidentiality.
Decoding fails when the input contains characters outside the Base64 alphabet, has incorrect padding, or mixes URL-safe and standard variants. Check that the string only contains A–Z a–z 0–9 + / = (or - _ for URL-safe).
To deepen your understanding of Base64 encoding, consult the following authoritative references: