Base64 Encode & Decode
Encoding & CryptoEverything 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
Image to Base64
Web & NetworkConvert 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
Encoding & CryptoEscape 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
Encoding & CryptoCompute MD5, SHA-1, SHA-256 or SHA-512 digests of any text, hashed as UTF-8 bytes so they match openssl and sha256sum exactly. Runs in your browser.
HTML Entities
Encoding & CryptoTurn < > & and quotes into HTML entities and decode them back in a single pass, so &lt; becomes <, not an angle bracket. Runs in your browser.
JWT Decoder
Encoding & CryptoSplit a JWT into header, payload and signature, and read iat, nbf and exp as dates. The signature is not verified — decoding only, all in your browser.
Unicode Escape
Encoding & CryptoConvert non-ASCII text and emoji into \uXXXX or \xXX escapes and back, with emoji written as proper surrogate pairs. Runs entirely in your browser.