Base64 encoder and decoder

bytes →


        
    

Examples

Input text

Hello, World!

Base64

SGVsbG8sIFdvcmxkIQ==

Base64 Guides & articles

Related tools

Base64 decoder and Base64 encoder online is often used together with JWT decoder: decode a JWT token online, JSON formatter, validator and beautifier online, URL decoder and URL encoder online when payloads, tokens, URLs, logs, or markup move through the same workflow.

Base64 encoder and decoder

Decode Base64 to text and encode Unicode text with optional URL-safe output. DevToolGrid Online offers a free Base64 decoder and Base64 encoder online.

What is Base64?

Base64 is an encoding scheme that represents binary data as ASCII text using 64 characters (A–Z, a–z, 0–9, + and /). It is widely used to embed images in CSS or HTML, carry binary data inside JSON or email, and store small files as text. Base64 is encoding, not encryption — it does not protect or hide data.

How to encode and decode Base64

  1. 1 Paste text into the input panel, or pick a file to encode.
  2. 2 Click Encode to convert to Base64, or Decode to read Base64 back.
  3. 3 Enable URL-safe if the value will be used in a URL or filename.
  4. 4 Copy the result, preview images, or download the decoded bytes.

Common Base64 mistakes

  • Wrong paddingStandard Base64 is padded with = so its length is a multiple of 4. Removing or adding padding breaks decoding.
  • Standard vs URL-safeURL-safe Base64 replaces + and / with - and _. Decoding URL-safe data with a standard decoder fails.
  • Treating it as encryptionBase64 is fully reversible by anyone. Never use it to protect passwords or secrets.

Base64 encode and decode in code

Base64 encode Python

base64.b64encode(text.encode("utf-8"))

Decode base64 Python

base64.b64decode(data).decode("utf-8")

Base64 encode JavaScript

btoa(str)  //  Buffer.from(str).toString("base64")

Decode base64 JS

atob(b64)  //  Buffer.from(b64, "base64").toString("utf8")

Base64 encode bash / Linux

printf '%s' "$v" | base64 -w 0

Base64 decode command line

base64 -d payload.txt > out.bin

Decode base64 PowerShell

[Text.Encoding]::UTF8.GetString([Convert]::FromBase64String($b64))

Base64 encode and decode in Java

Base64.getEncoder().encodeToString(bytes)

Decode base64 C#

Convert.FromBase64String(b64)

Base64 vs Base64URL

Standard Base64 uses + and / and = padding, which are unsafe in URLs and filenames. Base64URL replaces + with -, / with _ and usually drops the padding, so the result is safe to place in query strings, JWTs and file names. This tool supports both with a single toggle.

FAQ

Is this tool free?

Yes. The Base64 encoder and decoder is completely free, with no sign-up or limits.

Is my data sent to a server?

No. Encoding and decoding run locally in your browser, so files and text never leave your device.

Can it encode files and images?

Yes. Drop a file to get Base64, build a data URI, and preview images directly in the browser.

What is URL-safe Base64?

A variant that uses - and _ instead of + and / so the value can be used safely in URLs, filenames and tokens.

Do I need a Base64 decoder download?

No. This Base64 decoder tool runs in the browser, so there is no installer and no Base64 decoder website sign-up. A Base64 decoder and encoder in one page handles both directions.

Does it work as a Base64 encoder and decoder together?

Yes. The same panel is a Base64 encoder decoder pair: Base64 encode decode in one place, Base64 encode online for text or files, and a Base64 to text converter for the reverse.

Can it Base64 encode an image or a binary file?

Yes. Drop a file to Base64 encode an image, a PDF or any binary file, then decode Base64 to file form again and download the bytes.