Base64 Encoder and Decoder
Paste text or Base64, pick a direction, and copy the result. Everything runs in this tab.
- Input
- Text · Base64 · file
- Output
- Text · Base64 · Data URL
- Processing
- In your browser
- Cost
- Free · no sign-up
Input
Use URL-safe when the value has to sit inside a link or a file name. Decoding accepts either form automatically.
Base64
LiveYour data is processed locally in your browser and is never sent to Nekhen.
About this tool
Base64 rewrites arbitrary data using only 64 characters that survive being pasted into an email, a URL, a JSON document or a configuration file. It is an encoding, not encryption: anyone can decode it, and it protects nothing.
The reason a browser-based tool is worth having is Unicode. The functions built into JavaScript, `btoa` and `atob`, work on single bytes and simply throw an error on anything above U+00FF — so they cannot encode `café`, let alone an emoji. This tool converts to UTF-8 first, which is what every system that reads the result expects.
Steps
How to use it
- Choose the directionEncode turns text into Base64; Decode turns Base64 back into text.
- Paste your valueLine breaks and padding in pasted Base64 are handled for you.
- Pick an alphabet if you need oneThe URL-safe form swaps + and / for - and _ so the value can sit in a query string.
- Copy the resultOr drop a small file in to get a Data URL instead.
Real situations
Common uses
- Reading a Base64 value out of a JSON Web Token, a config file or an API response
- Embedding a small icon in CSS or HTML as a Data URL, with no extra request
- Passing text through a system that only accepts plain ASCII, such as an email header
- Checking what a Base64 string in a log line actually contains
Privacy
Files are processed locally in your browser and are never uploaded to Nekhen. Every calculation runs on your own device, so we never receive the contents of your file, never store it and never log it. Closing the tab clears everything from memory. More detail on the privacy page.
Common questions
Frequently asked
Is Base64 a form of encryption?
No, and treating it as one is a real security mistake. Base64 is a reversible encoding with no key: anyone who has the value can decode it in one step, including with this page. Never use it to hide a password, a token or personal data.
Why is the encoded value longer than what I typed?
Base64 represents every three bytes as four characters, so the result is about 33% larger, plus padding. That cost is the price of being safe to paste anywhere.
What is the URL-safe alphabet for?
Standard Base64 uses + and /, which both have a special meaning inside a URL and have to be escaped again. The URL-safe variant from RFC 4648 uses - and _ instead, and is normally written without the = padding. Decoding here accepts either form automatically.
Why does decoding sometimes say the result is not text?
Because it genuinely is not. Base64 of a PNG or a zip file decodes perfectly into bytes, but those bytes are not UTF-8 characters and cannot be shown as text. The tool says so rather than printing a row of replacement symbols.
Is my text or file sent anywhere?
No. Encoding is arithmetic performed in your browser, and a file you drop is read from your own device. Nothing is uploaded to Nekhen and nothing is stored.
More tools