Base64 Encoder & Decoder

Encode text to Base64 or decode Base64 back to text, with full UTF-8 support and an optional URL-safe mode.

Updated October 7, 2026 By

Runs in your browser Free · No sign-up

Loading tool…

How to use the Base64 Encoder & Decoder

  1. Choose “Encode” or “Decode”.
  2. Type or paste your text – the result appears instantly.
  3. Copy the result, or use it as the new input to convert back.

About this tool

Base64 turns any data into plain letters and digits so it can travel safely in emails, URLs, JSON or HTTP headers. This tool converts in both directions and correctly handles accented letters, emoji and non-Latin scripts.

  • Private: your data is processed on your device and never uploaded.
  • Free with no account, limits or watermarks.
  • Fast: results appear instantly, even offline once the page has loaded.

What the Base64 Encoder & Decoder does

Base64 is a way of writing any data using only 64 safe characters: A–Z, a–z, 0–9, plus “+” and “/”. It is used wherever binary data or special characters have to travel through systems that only handle plain text, such as email attachments, JSON APIs, data URLs in HTML and CSS, basic HTTP authentication and JSON Web Tokens.

This tool encodes text to Base64 and decodes Base64 back to readable text as you type. It fully supports UTF-8, so umlauts, accents, Persian or Chinese characters and emojis survive the round trip unchanged — a common problem with simpler converters. An optional URL-safe mode replaces “+” and “/” with “-” and “_” and drops the “=” padding, which is the variant used in URLs, file names and JWTs.

Encoding and decoding happen locally in your browser. Nothing you paste is sent to a server, so you can safely decode tokens or configuration values that contain private information.

When to use it

  • Reading API data

    Many APIs return fields such as attachments, signatures or encoded payloads in Base64. Decode them to see what they contain.

  • Inspecting tokens

    The header and payload of a JSON Web Token are URL-safe Base64. Paste a part between the dots to read its JSON.

  • HTTP Basic authentication

    The Authorization header contains “username:password” encoded as Base64. Create or check such a value for testing.

  • Configuration and secrets

    Kubernetes secrets, CI variables and some config files store values as Base64. Decode them to verify they are correct.

Tips for the best results

  • Base64 is an encoding, not encryption. Anyone can decode it, so never use it to hide passwords or sensitive data.
  • Encoded text is about 33% longer than the original, because every 3 bytes become 4 characters.
  • If decoding fails, check for missing characters at the end or line breaks copied from an email; whitespace is ignored automatically.
  • Use URL-safe mode whenever the result will appear in a web address, a cookie or a file name.
  • Use the swap button to check a result: encode a text, swap, and you should get the original back.

How the Base64 Encoder & Decoder works

For encoding, the text is first converted to UTF-8 bytes. Each group of three bytes (24 bits) is split into four 6-bit numbers, and each number is replaced by one of the 64 characters of the Base64 alphabet. If the last group is incomplete, “=” signs pad the result to a multiple of four characters.

Decoding reverses the process. The tool removes spaces and line breaks, converts URL-safe characters back to the standard alphabet, adds missing padding and then decodes the bytes strictly as UTF-8. If the bytes are not valid text — for example because the Base64 contains an image — you get an error message instead of garbled characters.

This page works with text. Binary files such as images or PDFs are not converted here.

Frequently asked questions

Is Base64 encryption?

No. Base64 is an encoding, not encryption. Anyone can decode it, so never use it to protect passwords or secrets.

What is URL-safe Base64?

It replaces “+” and “/” with “-” and “_” and drops the “=” padding, so the result can be used in URLs and file names without further escaping.

Why does my Base64 end with “=” or “==”?

The equals signs are padding. They appear when the original data length is not a multiple of three bytes and make the total length a multiple of four.

Can I decode a JWT with this tool?

Yes, the header and payload. Copy the part before the first dot or between the two dots and decode it. The signature part is binary and does not decode to readable text.

Why do I get an error when decoding?

The input is not valid Base64, it was cut off, or it encodes binary data rather than text. Make sure you copied the complete string.