Base64 Encoder & Decoder
Encode text to Base64 and decode it back — with proper UTF-8 handling (Chinese and emoji won't break) and an URL-safe mode. Everything stays in your browser.
Runs locally in your browser
Input
Output
How to use Base64 Encoder
- Paste text into the input box.
- Choose Encode or Decode depending on the direction.
- Copy the result with one click.
Common use cases
- Embed small assets as data URIs in CSS or HTML.
- Decode a Base64 token while debugging an API.
- Encode UTF-8 text — Chinese and emoji included — without corruption.
- Prepare a basic-auth header for a quick test request.
Good to know
- Base64 is encoding, not encryption — never use it for secrets.
- URL-safe mode swaps reserved characters for use in links.
- Very large inputs are better handled by a dedicated file tool.
What you can do next
FAQ
Is my data uploaded?
No. Encoding is built into your browser — tokens, credentials and payloads stay on your device.
Why do other tools mangle Chinese text?
JavaScript's native btoa() only handles Latin-1. This tool routes through TextEncoder/TextDecoder, so any UTF-8 text — Chinese, emoji, Arabic — round-trips correctly.
When do I need URL-safe Base64?
When the encoded value goes into a URL or filename (JWTs, tokens in links) — standard Base64's + and / characters break URLs, so they're swapped for − and _.