# Base64 Encoder / Decoder

Canonical URL: https://offlineutils.com/base64
Category: Developer
Published: 2026-06-24
Publisher: offlineutils.com
Runs entirely in the browser; nothing entered into the tool is uploaded.

> A Base64 tool encodes arbitrary text or binary data into the Base64 ASCII representation and decodes Base64 strings back to their original form, performed entirely in the browser with no server round-trip.

Paste a string to encode it as Base64, or paste a Base64 blob to decode it back to UTF-8 text. The tool uses the browser's native btoa/atob along with TextEncoder/TextDecoder so it correctly handles Unicode characters that the raw btoa would otherwise reject. Use it to embed payloads in URLs, debug API responses, or inspect JWT segments.

## Features

- Encode arbitrary text to standard Base64
- Decode Base64 back to UTF-8 text
- Unicode-safe via TextEncoder/TextDecoder around native btoa/atob
- Detects and decodes Base64URL (URL-safe '-' and '_' variant)
- Side-by-side input/output editors with one-click copy
- Zero network — encoding runs on the browser's native primitives

## Use cases

- Decoding the header or payload of a JWT to inspect the claims
- Encoding a binary payload to embed it as a data URI in HTML or CSS
- Round-tripping non-ASCII text (emoji, CJK, accented Latin) safely
- Inspecting Base64-encoded fields in a SAML or OAuth response
- Encoding short payloads for compact URL parameters

## How to use it

1. **Paste your text** — Paste raw text into the encode pane, or paste a Base64 string into the decode pane.
2. **Choose Base64 or Base64URL** — Toggle Base64URL if your token uses the URL-safe alphabet (used by JWTs).
3. **Copy the result** — The output updates live as you type. Click Copy to put it on your clipboard.

## When to use it, and when to use something else

- **vs OpenSSL or `base64` CLI** — use Base64 Encoder / Decoder when you want an instant visual round-trip in the browser. Use OpenSSL or `base64` CLI when you are scripting in a shell pipeline.
- **vs Online Base64 image encoder** — use Base64 Encoder / Decoder when you have plain text or a payload string. Use Online Base64 image encoder when you need to embed an actual image file as a data URI.

## Frequently asked questions

### Does the tool handle emoji and non-ASCII characters?

Yes. We pipe the input through TextEncoder before calling btoa, so multi-byte Unicode like emoji, CJK characters, and accented letters round-trip correctly.

### Is Base64 encryption?

No. Base64 is an encoding — anyone who sees the string can decode it back instantly. Never use it to hide passwords or secrets.

### What's the difference between Base64 and Base64URL?

Base64URL replaces the '+' and '/' characters with '-' and '_' so the result is safe to embed in URLs and filenames without escaping. JWTs use Base64URL.

### Can I decode a Base64-encoded image?

This tool handles text only. To preview a Base64 image, paste it into an HTML <img> tag's src attribute as a data URI.

## Related tools

- https://offlineutils.com/url-encoder
- https://offlineutils.com/jwt-decoder
- https://offlineutils.com/hash-generator
