Base64 Encoder & Decoder
Paste text on the left, then Encode or Decode. Full UTF-8 support — everything runs in your browser.
What Base64 is (and is not)
Base64 writes arbitrary bytes using 64 printable ASCII characters: A-Z, a-z, 0-9, plus, and slash, with = as padding. The point is transport. Email bodies, JSON strings, HTTP headers, and data: URLs are happier with text than with raw bytes. Three bytes of input become four characters of output, so the encoded form is about a third longer than the original.
It is an encoding, not encryption. Anyone can decode it. This page treats the input as Unicode text, converts it to UTF-8 bytes, then applies the standard Base64 alphabet. Decode reverses that: Base64 to bytes, then UTF-8 to text. Whitespace in a Base64 paste is stripped before decode, so a value copied with line breaks still works.
How to use Encode and Decode
- Paste into the left pane labeled
Input. The header shows a character count as you type. Nothing converts until you click a button. - Click
Encode →to turn text into Base64. Status becomesEncoded to Base64. Mode readsEncode. Input and Output in the strip are character counts of the two panes. - Click
Decode ←to turn Base64 into text. Status becomesDecoded from Base64. Mode readsDecode. The Input count on decode is the Base64 length after whitespace is removed. Copy resultcopies the right pane.Clearwipes both sides and returns status toWaiting for input.
Encode will encode whatever is in the box, including leading spaces. Decode treats a box that is only whitespace as empty. A string the decoder cannot accept clears the output and sets Status to an invalid-Base64 message.
Worked example: the invisible newline in a secret
A Kubernetes Secret holds a database password in Base64, and the application keeps failing to log in even though the password looks right. The value in the manifest is czNjcjN0Cg==. Paste it and press Decode.
The output pane shows s3cr3t, which looks correct. The readout tells a different story: Output is 7 chars, but s3cr3t has only 6. The seventh character is a line feed. Encode s3cr3t on this page and you get czNjcjN0, without the Cg== at the end. Cg== is exactly how a single trailing newline byte encodes.
The usual cause is how the value was created. echo "s3cr3t" | base64 encodes the newline that echo adds, and produces czNjcjN0Cg==. printf 's3cr3t' | base64 does not add one, and produces czNjcjN0. Comparing the character counts in the readout is a quick way to catch this class of bug for any encoded credential or token.
Quick encodings to check against
Plain ASCII. Input hello, click Encode. Output: aGVsbG8=. The trailing equals mark is padding so the length is a multiple of 4. Input Fieldkit encodes to RmllbGRraXQ=. Input hello world encodes to aGVsbG8gd29ybGQ=. The space is part of the UTF-8 bytes. It does not become a plus.
UTF-8, not Latin-1. Input café, click Encode. Output: Y2Fmw6k=. The accented e is the two UTF-8 bytes C3 A9, which is why you see w6k rather than a single-byte mapping. Input of a check mark encodes to 4pyT. Decode of Y2Fmw6k= returns café.
A small JSON object. Input {"ok":true}, click Encode. Output: eyJvayI6dHJ1ZX0=. Paste that back, click Decode, and you get the original object text. This is the usual way config snippets are stored in text-only fields.
Padding, alphabets, and line breaks
Standard Base64 uses plus and slash, and pads with equals so the character count is a multiple of four. Some other alphabets swap plus and slash for hyphen and underscore and drop the padding. Those strings are not the same format. If Decode rejects the paste, look for a hyphen or underscore first. This page also strips spaces and line breaks on decode, which covers the 76-column wrapping you see in older mail messages.
When to encode or decode
Encode when you need to embed a short string inside a format that will mangle binary or reserved characters. Decode when you are reading a value that is already encoded and you want the original text. Typical cases:
- Reading the payload of a token or config field that looks like random letters
- Building a tiny
data:URL for an SVG or a snippet of text - Checking that an encode/decode round trip still looks like the source, including accents
Common mistakes
- Pasting a URL-safe variant that uses hyphen and underscore. Those characters are outside the alphabet this decoder accepts. Swap them back to plus and slash, then add equals until the length is a multiple of 4.
- Treating the output as a secret. Anyone with the string can decode it. The page is a converter, not a lock.
- Decoding a binary dump and expecting a useful string. This page decodes to text via UTF-8. Bytes that are not UTF-8 will be replaced, not shown as hex.
- Clicking Encode on a value that is already Base64. You will encode it a second time and get a longer, different string.
Limits and privacy
It does not encode files or images from disk. There is no file picker. It does not wrap lines at 76 characters. It does not speak hex or quoted-printable. It does not sign anything. It will not fetch a URL and encode the response.
UTF-8 conversion and the Base64 alphabet run in this tab. Nothing you paste is uploaded or stored. Closing the tab clears both panes.
Encoding without this page
Base64 turns bytes into ASCII text (and back). In modern browsers you can approximate the same flow with TextEncoder/btoa and atob/TextDecoder.
- Decide encode (text → Base64) or decode (Base64 → text).
- For encode: UTF-8 encode the string, then apply standard Base64.
- For decode: strip whitespace, decode Base64 to bytes, then UTF-8 decode.
- Treat the result as transport encoding — not encryption or hashing.
- Copy only the alphabet characters you need (A–Z, a–z, 0–9,
+,/,=).
Example: Encoding hello yields aGVsbG8=; decoding that string returns hello.
Base64 questions
Is this Base64URL?
This page targets standard Base64 for text. URL-safe variants replace +/ and padding — use the URL tool when encoding for query strings.
Will binary files work?
Prefer small text payloads here. Large binaries belong in local tooling.
Is my text uploaded?
Encode/decode runs in the browser tab only.