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
Base64 Encoder & DecoderInputText · Base64 · fileOutputText · Base64 · Data URL

Input

Direction

Use URL-safe when the value has to sit inside a link or a file name. Decoding accepts either form automatically.


Or encode a file
Drop a file here, or click to chooseAny type, up to 2 MB — the result is a Data URL

Base64

Live

Your 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.

Text encoding matters: JavaScript’s `btoa` accepts byte-valued characters, so `btoa("café")` produces Latin-1 bytes rather than UTF-8, and an emoji causes an error. This tool encodes text as UTF-8 first: `café` becomes `Y2Fmw6k=`. Decode mode expects UTF-8 text too.


Steps

How to use it

  1. Choose the directionEncode turns text into Base64; Decode turns Base64 back into text.
  2. Paste your valueLine breaks and padding in pasted Base64 are handled for you.
  3. Pick an alphabet if you need oneThe URL-safe form swaps + and / for - and _ so the value can sit in a query string.
  4. 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. 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. The receiving system still needs to expect Base64 and the chosen alphabet.

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

See all tools →

Practical guide

Use this tool in a real workflow