Overview / Developer & Code / Base64 Encoder & Decoder
Developer & Code 100% In-Browser & Offline

Base64 Encoder & Decoder

Encode text to Base64 and decode it back with full UTF-8 support and a URL-safe option.

Paste or type your input; results appear instantly and errors are shown below the input.

Your files and input never leave your browser – nothing is uploaded.

Plain text input

Base64 result

Paste text, read Base64. Switch the mode, paste Base64, read the text. The Base64 encoder updates on every keystroke, so there is no convert button to look for.

Base64 exists for systems that take only plain ASCII, such as an HTTP header, a JSON field, a config value or a query string. It uses letters, digits, +, / and = as padding. The price is size: the output is about one third longer than the input.

Basic auth, JWT and Kubernetes: three places you meet Base64

HTTP Basic authentication is the classic case. The pair user:pass becomes dXNlcjpwYXNz, and that value goes after Authorization: Basic.

A JSON Web Token has three parts separated by dots. The first two are Base64url-encoded JSON. Paste the middle part in decode mode and you can read the claims, for example the expiry time. The tool does not check the signature.

Kubernetes Secret manifests also store values in Base64. Decode one before you apply the file, and a stray newline or a typo in the password becomes visible.

Why ä needs two bytes

The tool turns text into UTF-8 bytes first and encodes those. So ä is two bytes and becomes w6Q=. A tool that works in Latin-1 gives 5A== for the same letter, and the two results do not match. The rocket emoji in the sample text takes four bytes and becomes 8J+agA==.

The Base64 encoder controls, left to right

  1. Choose Encode (Text → Base64) or Decode (Base64 → Text). Encode is active when the page opens. The text in the left box stays where it is when you switch, and the right box is computed again from it.
  2. Type or paste into the left box. It starts with the sample Hello World! äöü ß 🚀. Press Clear to empty both boxes.
  3. Read the result in the right box.
  4. To use the output in a URL or a file name, switch on URL-safe Base64. It replaces + and / with - and _ and removes the = padding.
  5. Press Copy, or press Download to save a text file named encoded.base64.txt or decoded.txt.

Data URIs, binary files and where your text goes

The tool works on text only and has no file picker. Decoding Base64 that came from an image or a ZIP file gives unreadable characters, and invalid UTF-8 bytes show as �. Decoding accepts both alphabets and missing padding. The URL-safe switch only affects encoding.

A data URI prefix such as data:image/png;base64, is not removed. Cut it off by hand, or the result box shows the error message, and Copy and Download take that message as well. The code sets no size limit, but a very large text slows the tab.

The conversion runs in JavaScript in your browser. Typing or switching the mode sends no request, and the network panel of your developer tools shows it. Copy writes to your clipboard and Download saves a file on your device. Remember that Base64 is an encoding, not encryption. Anyone can decode it.

Frequently asked questions (FAQ)

Choose Decode, then paste the string into the left box. Standard and URL-safe Base64 both work, and missing = padding is added for you.