Decode a simple word
SGVsbG8gV29ybGQ=
Hello World
The trailing = is padding because Hello World is 11 bytes, which is not a multiple of 3. Decoding always strips it correctly.
Instantly encode or decode Base64 strings and files.
Last updated
Base64 is an encoding scheme that represents binary data using 64 printable characters. Developers reach for it whenever a text-only system needs to carry bytes — small images embedded in HTML, tokens, email attachments, data URLs, copy-pasteable secrets in logs, and JSON fields that store binary blobs.
Base64 is *encoding*, not encryption. Decoding a Base64 string usually reveals the original content immediately, so it should never be treated as a security boundary. Anything inside Base64 is effectively public unless it has been encrypted *before* being encoded.
Under the hood, Base64 takes 3 bytes (24 bits) and rewrites them as 4 characters from a fixed 64-character alphabet (A–Z, a–z, 0–9, +, /). When the input length isn't a multiple of 3, the encoder adds one or two = characters at the end as padding. That's why Base64 strings often end with =.
= complete the final group of 4 and are normal in many Base64 strings.Choose Encode if you have plain text or a file and want Base64 output. Choose Decode if you have a Base64 string and want the original content back.
Paste a string into the text box, or drag a file (image, PDF, anything) onto the drop zone. Files are converted to a data: URL ready to embed in HTML or CSS.
Encoded output is the Base64 string. Decoded output is the original text — or, if the input was a file, the recovered bytes shown as a download link.
Click the copy button to put the result on your clipboard. Everything runs in your browser, so the input never leaves your machine.
The pieces you'll keep meeting once you start working with Base64 — defined by RFC 4648.
| Element | Meaning | Example |
|---|---|---|
| Alphabet | 64 characters used by standard Base64 | A–Z, a–z, 0–9, +, / |
| URL-safe alphabet | Used by JWTs and URLs | A–Z, a–z, 0–9, -, _ |
| Padding | Pads the final group when length isn't a multiple of 3 | = or == |
| Group size | Bytes per encoded chunk → 4 output chars | 3 bytes → 4 chars |
| Length growth | Output is ~33% larger than input | 100 B → 136 chars |
| Data URL | Inline file embed for HTML/CSS | data:image/png;base64,... |
SGVsbG8gV29ybGQ=
Hello World
The trailing = is padding because Hello World is 11 bytes, which is not a multiple of 3. Decoding always strips it correctly.
{"role":"student","active":true}eyJyb2xlIjoic3R1ZGVudCIsImFjdGl2ZSI6dHJ1ZX0=
JWT tokens encode each segment exactly like this — that's why JWT payloads usually start with eyJ, which is the Base64 form of {".
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNgAAIAAAUAAen8GVAAAAAASUVORK5CYII=
The prefix declares the media type (image/png) and the encoding (base64). Everything after the comma is the file content. Useful for tiny images that load with the page.
Pj4/Pyc+Pg==
Pj4_Pyc-Pg
URL-safe Base64 swaps + for - and / for _ so the value can sit inside a URL without further escaping. JWTs use this variant.
= padding manually and feeding the result to a strict decoder that expects it. (URL-safe decoders usually accept missing padding; standard decoders may not.)= characters are added as padding.atob() in browsers, Buffer.from(str, 'base64') in Node.js, base64.b64decode() in Python.=?= is padding. Base64 emits 4 characters for every 3 bytes of input. When the input length is not a multiple of 3, one or two = are added so the encoded length stays a multiple of 4.data:image/png;base64,... URL so the image is embedded directly in HTML, CSS, or JSON without a separate network request.