Developer Tools
Base64 Encoder and Decoder
Encode Unicode text to Base64 or decode it back. Optional URL-safe mode uses - and _ and strips padding. Encoding uses UTF-8 via encodeURIComponent.
Your workspace
Runs in your browserHow to use
- 1Paste text on the left to encode, or Base64 on the right to decode.
- 2Toggle URL-safe if you need it.
- 3Click Encode or Decode.
Worked example: Encode and decode a short string
Base64 represents bytes with text characters. It is not encryption and does not protect a secret. Unicode text is converted through UTF-8 before encoding, which is why a Japanese or Bengali character can use more bytes than an English letter.
- Example input
- hello
- Expected result
- aGVsbG8=; decoding it returns hello.
Check before you use the result
Decode your encoded value and compare it with the original, including spaces and line breaks. A trailing newline changes the byte sequence.
If the result is different
A URL-safe Base64 variant can use different characters from ordinary Base64. Check the format required by the receiving system; do not assume a pasted token is encrypted just because it looks unreadable.
Is this the right tool?
Base64 Encoder converts text to Base64 and decodes it back. Base64 is reversible encoding, so it does not protect passwords or confidential information.
- Before you start
- Distinguish plain text from encoded text and use the matching direction. This workspace handles text rather than arbitrary binary files.
- When to choose another approach
- Use Hash Generator for a one-way text digest rather than reversible encoding.
What this tool does
- — UTF-8 text
- — URL-safe option
- — Copy result
Useful when
- — Debugging data URLs
- — JWT playgrounds
- — Config snippets
Where processing happens
Encoding and decoding run in the browser with btoa/atob plus UTF-8 helpers.
Questions
Can I encode files?
This version encodes text, not arbitrary binary files.
How can I check that Base64 decoding preserved my text?
Decode your encoded value and compare it with the original, including spaces and line breaks. A trailing newline changes the byte sequence.
What should I check if Base64 decoding fails?
A URL-safe Base64 variant can use different characters from ordinary Base64. Check the format required by the receiving system; do not assume a pasted token is encrypted just because it looks unreadable.
Guides for this tool
- How to debug JSON, Base64 and cron in your browser
Validate JSON, round-trip Base64 text and check five-field cron syntax using local browser tools.
- How to format and validate JSON
Beautify or minify JSON in the browser, read parser errors, and avoid pasting secrets into a random formatter.
- How to hash text (and why you cannot un-hash it)
MD5, SHA-1, SHA-256, and SHA-512 in the browser. Compatibility vs password storage.
Related tools
Technical references
- RFC 4648: Base64 encoding
The encoding specification. Encoding represents data; it does not provide confidentiality.
More in Developer Tools · Guides
Instructions maintained by ToolNest. Found an incorrect result or an unclear step? Report the tool name and steps.