Base64 Encode and Decode Directly in Your Browser

Base64 shows up everywhere in development: JWT tokens, API keys in config files, image data URIs in CSS, HTTP Basic Auth headers, email MIME attachments. The problem isn't understanding what Base64 is — it's the friction of actually encoding or decoding a string when you need to.

The two most common workarounds are a terminal command (echo -n "text" | base64) or a random web tool. Terminal commands are fine if you're on a Unix machine with a terminal open, but they're clunky on Windows and require switching context. Random web tools work but you're sending your data — often API keys, tokens, or config values — to an unknown server.

There's a cleaner option: a browser extension that does the conversion locally, without uploads, without leaving your browser.

What Is Base64?

Base64 is a binary-to-text encoding scheme. It converts arbitrary data into a string made of 64 printable ASCII characters (A–Z, a–z, 0–9, +, /), with = used as padding. The encoded output is roughly 33% larger than the input.

The purpose isn't compression or security. It's to safely transmit data through systems that only handle text, or to embed binary data in formats that expect strings (like JSON, XML, or CSS). Anyone with the encoded string can decode it.

When You Actually Need Base64

JWT tokens: A JSON Web Token has three Base64url-encoded sections joined by dots. The header and payload aren't encrypted — decoding the middle section reveals the raw JSON claims: expiry, user ID, roles, scopes.

HTTP Basic Auth: The Authorization: Basic <value> header contains a Base64-encoded username:password string. Decoding it is a quick way to verify what credentials a request is actually sending.

Data URIs: Small images and SVGs can be embedded directly in CSS or HTML as data:image/png;base64,… URIs. You need to Base64-encode the file content to produce the embed string.

Config files: Kubernetes secrets, CI environment variables, and many other tools store sensitive values as Base64-encoded strings in YAML or JSON. You encode the raw value before pasting it into the config.

Email MIME: Email attachments are Base64-encoded in the raw message body. When debugging email delivery or parsing raw MIME messages, you'll need to decode the attachment payload.

Why Not Just Use the Terminal or a Web Tool?

Method The friction
echo -n "…" | base64 Only works on macOS/Linux. Requires a terminal and the exact syntax (-n is critical — without it you encode a trailing newline).
certutil -encode (Windows) Adds a header/footer you have to strip. Writes to a file, not stdout. Awkward for quick one-offs.
Online web tools Your data goes to a remote server. Fine for generic text; bad habit for tokens, credentials, or keys.
Python one-liner Requires Python installed and a terminal — more steps than it should be for something this common.

A browser extension solves all of these: always available, no terminal needed, runs entirely on your machine.

How to Encode and Decode Base64 with TextForge

TextForge is a Chrome extension with over 50 text utility functions. Base64 encode and decode are both included. No data leaves your machine — everything runs in the extension's local context.

Encoding: Text → Base64

  1. Install TextForge from the Chrome Web Store. Pin the icon to your toolbar so it's always one click away.
  2. Open the extension by clicking the TextForge icon in your browser toolbar.
  3. Paste your text — the string you want to encode. It can be plain text, a URL, JSON, or any string you need in Base64 form.
  4. Apply Base64 Encode — select the function from the tools menu. The encoded output appears immediately.
  5. Copy the result to your clipboard. Done — no page load, no server round trip.

Decoding: Base64 → Text

The process is identical in reverse: paste the Base64 string, select Base64 Decode, and copy the original text.

Practical Examples

Inspecting a JWT payload. Split any JWT at the dots. The second section is the payload — Base64url-encoded JSON. Paste it into TextForge, decode it, and you see the raw claims. (Base64url uses - instead of + and _ instead of /, but for payload inspection it decodes fine.)

Creating a Kubernetes secret. Kubernetes stores secret values as Base64-encoded strings in the manifest. Encode your raw password or API key with TextForge and paste the result directly into the data: block of your secret YAML.

Verifying a Basic Auth header. Capture the Authorization header from DevTools, strip the leading Basic prefix, paste the rest into TextForge, decode it, and confirm the username:password pair is correct.

Other Text Utilities in TextForge

Base64 is one of over 50 functions in TextForge. If you work with text in the browser, you'll also find frequent use for: cleaning whitespace, converting case, sorting lines, extracting emails or URLs from a block of text, generating UUIDs, and creating slugs from titles. It's a general-purpose text toolkit that stays useful far beyond Base64.


TextForge is free to install. Base64 encode and decode are available in the free version — no account or subscription required.

Install TextForge from the Chrome Web Store →