Developer Tools — 9 tools

Base64 Encode & Decode

Encode and decode Base64 in your browser — text or whole files. Full UTF-8 support handles emoji and accents correctly, and a URL-safe option makes the output safe for links and filenames. Nothing is uploaded.

 

What is Base64 encoding used for?

Base64 represents arbitrary binary data using only 64 printable ASCII characters. That matters whenever data has to travel through a channel built for text: embedding an image in a CSS or HTML data: URI, putting a file inside a JSON API request, attaching binary to an email, or storing a small blob in a config file. Encoding adds about 33% to the size (every 3 bytes become 4 characters) but guarantees the bytes survive the trip intact. The alphabet and padding rules are defined in RFC 4648.

Encoding text vs decoding Base64

Encoding turns readable text or raw bytes into a Base64 string; decoding reverses it. This tool encodes through UTF-8, so multi-byte characters — accented letters, non-Latin scripts, emoji — round-trip perfectly instead of being mangled the way a byte-only encoder would mangle them. Switch direction with the Encode / Decode toggle at any time.

URL-safe Base64 and files

The optional URL-safe mode swaps the + and / characters for - and _ (the "base64url" alphabet from section 5 of RFC 4648, the same one JSON Web Tokens use) and removes padding, so the result can live inside a URL or filename. You can also encode a whole file locally to get the Base64 you would paste into a data URI. Everything runs on your device — no uploads — which keeps sensitive files private.

Frequently asked questions

How do I encode text to Base64?

Keep the direction on "Encode", type or paste your text, and the Base64 output appears instantly. The encoder is fully Unicode-aware, so emoji and accented characters are converted through UTF-8 first — you get correct output where a naive encoder would throw an error or corrupt the bytes.

What is URL-safe Base64?

Standard Base64 uses + and / characters and = padding, which have special meaning in URLs and filenames. URL-safe Base64 replaces + with -, / with _, and drops the padding, so the string can be dropped into a query parameter or path segment untouched. Tick "URL-safe" to produce it; decoding accepts either variant automatically.

Can I Base64-encode a file or image?

Yes. In Encode mode, use "Encode a file" to pick any file — an image, PDF, or binary — and the tool reads it locally and outputs its Base64 representation, ready to embed in a data URI or JSON payload. The file is never uploaded; it is read directly in your browser.

Why does decoding fail on my string?

Base64 decoding fails when the input contains characters outside the Base64 alphabet, has been truncated, or is actually URL-encoded rather than Base64. Remove surrounding quotes, whitespace, or a data-URI prefix like "data:image/png;base64," and try again — the tool ignores stray line breaks but needs a clean Base64 body.

Is Base64 a form of encryption?

No. Base64 is an encoding, not encryption — anyone can decode it, so it provides no security. It exists to represent binary data safely as ASCII text for transport in JSON, URLs, email, or HTML. To protect data you need real encryption; to obscure it for transport you use encoding like this.

What is the difference between Base64 encoding and decoding?

They are the two directions of the same transformation. Encoding takes readable text or raw bytes and rewrites them using only the 64 safe ASCII characters, which is what you need before putting binary data into JSON, a URL, or an email. Decoding reverses it, turning that ASCII string back into the original bytes. This page does both: switch the direction tabs to encode and decode without reloading, and the output pane updates as you type.

Is my data sent to a server?

No. All encoding and decoding runs locally in your browser with no network requests, so your text and files never leave your device — safe for tokens, keys, or private payloads. For inspecting a JSON Web Token specifically, try our JWT decoder.