Back to Developer
Base64 encode / decode — URL-safe variant supported

Base64 encode / decode — URL-safe variant supported

Convert between plain text and Base64. Encode with an optional URL-safe variant; decoding accepts URL-safe (- _, no padding) automatically. UTF-8 safe and runs entirely in your browser.

developerencodedecode

How to use

Pick a mode (Encode / Decode), paste text or Base64, then press Run. In Encode mode, toggle URL-safe to replace + / with - _ and strip trailing = padding (required for JWT / URL query strings). In Decode mode the tool automatically accepts both standard and URL-safe inputs (- _ alphabet, padding optional). UTF-8 based, so Japanese and emoji round-trip safely. Copy the result or download it as .txt.

FAQ

Is my input sent to any server?
No. Encoding / decoding runs entirely in your browser (btoa / atob + TextEncoder/TextDecoder). Nothing leaves your device.
What is URL-safe Base64?
Standard Base64 (RFC 4648 §4) uses + and / and trailing =, which conflict with URL query syntax. URL-safe Base64 (§5) replaces + → -, / → _ and drops padding. Used by JWT, OAuth state and similar URL-embedded encodings.
Do I need to specify URL-safe when decoding?
No. The decoder automatically accepts both standard and URL-safe inputs — it normalizes - _ to + / and adds any required padding before decoding.
I get garbled characters when decoding
Encoding treats input as UTF-8. If decoded output looks wrong, the source likely was not UTF-8 encoded. Binary use cases are on the roadmap.
Why merge encode and decode into one tool?
Encoding and decoding Base64 are two directions of the same conversion. A mode toggle keeps them in a single UI. The URL-safe checkbox only appears in Encode mode; decode handles both variants automatically.
Can I encode binary files (images, etc.)?
This tool focuses on text input. A binary-to-Base64 tool is on the roadmap.

Related tools