Base64 Encode & Decode
EncodingEverything runs locally in your browser — nothing is uploaded
Convert between plain text and Base64 in both directions, with correct handling of accented characters, CJK and emoji. Turning on the URL-safe variant swaps + and / for - and _ and drops the trailing =, so the result can go straight into a URL, a filename or a JWT. Decoding tolerates line breaks and missing padding, which makes pasting from elsewhere painless.
Features
- Both directions: text ⇄ Base64
- Correct UTF-8 handling for accented text, CJK and emoji
- URL-safe variant: + → -, / → _, padding removed
- Decoding tolerates line breaks, spaces and missing padding
- Results update as you type — no button to press
How to use
- Choose the direction: encode or decode
- Tick the URL-safe variant if you need it
- Paste your content — the result appears instantly
- Click Copy to take the result
FAQ
- Why does my text encode differently elsewhere?
- Base64 encodes bytes, not characters. The same string is 6 bytes in UTF-8 but 4 in GBK, so the output differs. This tool always uses UTF-8, which is the convention across today’s web pages and APIs.
- When do I need the URL-safe variant?
- The standard Base64 alphabet contains + and /, both of which have special meaning in URLs. Use the variant whenever the output goes into a URL, a filename or a cookie.
- What does "not valid UTF-8 text" mean when decoding?
- The Base64 decoded fine, but the resulting bytes are not valid text — usually because the original content was binary such as an image or an archive rather than characters.
Related tools
Base32
EncodingConvert text to and from Base32 using the standard alphabet or base32hex. Non-ASCII text is encoded as UTF-8 bytes; decoding tolerates lowercase.
Base58 / 62 / 100
EncodingEncode and decode text as Base58, Base62 or Base100, with both the Bitcoin and Flickr Base58 alphabets. Non-ASCII text is handled as UTF-8 bytes.
Gzip
EncodingCompress text to gzip and get Base64 or hex, or decompress it back, with original size and ratio. Runs entirely in the browser.
Image to Base64
WebConvert an image to Base64 or a data URL by dropping, choosing or pasting it. Resize and switch format, all locally — nothing is ever uploaded.
URL Encode
EncodingEscape text into %XX form and back again, treating a whole URL and a single parameter value as different jobs. Runs entirely in your browser.
Hash
EncodingCompute MD5, SHA-1, SHA-256, SHA-512 or MD4 digests of any text, hashed as UTF-8 bytes so they match openssl exactly. Runs in your browser.