# Encode & Decode — Base64 encoder and decoder for Mac

Encode or decode Base64, URL encoding, HTML entities and hex. Part of OneMacTools, 151 private tools in one native Mac app (macOS 26 or later); category: Utilities. Runs on your Mac; nothing is uploaded.

Convert text to and from Base64 (including URL-safe Base64 and data: URLs), URL percent-encoding, HTML entities and hex. Decoded data that isn't text, such as a Base64 image, is saved as a file with the right extension. Everything happens on your Mac, so tokens and private data never touch a website.

Page: https://www.onemactools.com/tools/encode-decode · Download: https://www.onemactools.com/download · Pricing: https://www.onemactools.com/pricing

## How to use it
1. **Paste the text.** Paste the text you want to encode, or the encoded text you want to decode, such as a Base64 string or a URL with %20s in it.
2. **Choose the format.** Pick Base64, URL, HTML entities or Hex.
3. **Choose the direction.** Encode turns plain text into the format; Decode turns it back into plain text.
4. **Click Convert.** Or press Command-Return. The result appears below and is copied to the clipboard. If decoded data isn't text, such as a Base64 image, it's saved as a file instead.

## Options
- **Format:** Base64 (for email attachments, data: URLs and API tokens), URL (percent-encoding for links and query strings), HTML entities (for showing <, >, & and quotes safely in web pages) or Hex (each byte as two hexadecimal digits).
- **Direction:** Encode or Decode. Decoding Base64 accepts URL-safe Base64, missing padding, line breaks and whole data: URLs. Decoding hex accepts 0x prefixes, spaces and colons.

## Tips
- When encoding for a link, encode just the value that goes after the = sign, not the whole address. URL encoding also encodes : and /.
- Paste a whole data: URL to decode it. The data: part is skipped and an image inside is saved as a PNG, JPEG or GIF file.
- Use Hex to see the exact bytes in a piece of text, for example to spot invisible characters.
- Click Use as Input to decode something that was encoded twice, or to check a result by converting it back.

## Questions
**How do I decode a Base64 string on a Mac?**
Paste the string, choose Base64 and Decode, then click Convert. Text is shown and copied to the clipboard; an image or other file is saved to Downloads › OneMacTools.

**How do I encode text to Base64?**
Paste the text, choose Base64 and Encode, then click Convert. The Base64 is copied to your clipboard.

**How do I turn a Base64 data URL back into an image?**
Paste the whole data: URL, choose Base64 and Decode. The image is saved as a file with the right extension, such as .png or .jpg.

**How do I URL-encode a query string?**
Choose URL and Encode, paste the value and click Convert. Spaces become %20 and special characters are percent-encoded so the link works.

**How do I decode %20 and other codes in a URL?**
Choose URL and Decode, paste the URL and click Convert. Codes such as %20 and + become spaces and other characters are restored.

**Is it safe to decode tokens and private data here?**
Yes. Everything is converted on your Mac, so tokens and private data are never sent to a website.

**Why does it say that isn't valid Base64 or hex?**
The text contains characters that don't belong in that format, or hex with an odd number of digits. Check you copied the whole string and picked the right format.
