Base64 crops up in awkward places: you're debugging a JWT and need to see the payload, or you have a raw secret that needs to go into a YAML config in encoded form, or you're setting up an HTTP Basic Auth header and want to verify the credentials are correct. The encoding itself is trivial — the friction is the workflow.
The two most common solutions are a terminal command or a web tool. Terminal commands work on macOS and Linux but are clumsy on Windows. Web tools work everywhere, but you're pasting potentially sensitive data — API keys, tokens, credentials — into an unknown server. Neither is ideal for something you do regularly.
What Is Base64?
Base64 is an encoding scheme that converts binary or arbitrary text into a string of 64 printable ASCII characters (A–Z, a–z, 0–9, +, /), using = as padding to make the length a multiple of 4. The encoded output is about 33% larger than the original.
It's not encryption and it's not compression. The purpose is to safely carry binary or structured data through systems that only handle plain text — HTTP headers, JSON fields, CSS url() values, XML attributes. Anyone with the encoded string can decode it instantly.
When You Actually Need It
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:image/png;base64,… URIs. You need to Base64-encode the file's binary content to produce the string you embed.
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 right syntax — the -n flag is critical. Without it you silently encode a trailing newline. |
| certutil -encode (Windows) | Adds a -----BEGIN CERTIFICATE------style header and footer you have to strip. Writes to a file instead of stdout. |
| Online web tools | Your data goes to a remote server. Fine for generic text, but a bad habit for tokens, credentials, or private keys. |
| Python one-liner | Requires Python installed and a terminal context switch — more steps than it should be for something this routine. |
A browser extension removes all of that friction: always accessible from the toolbar, no terminal required, runs entirely on your local machine.
Encode and Decode Base64 with TextForge
TextForge is a Chrome extension with over 50 text utility functions. Base64 encode and decode are both included in the free version. No data leaves your machine — everything runs in the extension's local context.
Encoding: Text → Base64
-
1Install TextForgeInstall TextForge from the Chrome Web Store. Pin the icon to your toolbar from the Extensions menu so it's always one click away.
-
2Open the extensionClick the TextForge icon in your browser toolbar to open the extension panel.
-
3Paste your textPaste the string you want to encode into the input area. It can be plain text, JSON, a URL, a secret value — anything you need in Base64 form.
-
4Apply Base64 EncodeSelect Base64 Encode from the tools menu. The encoded output appears instantly — no loading, no server round trip.
-
5Copy the resultClick to copy the encoded string to your clipboard. You're done.
Decoding: Base64 → Text
The process is identical in reverse: paste the Base64 string, select Base64 Decode, and copy the original text. That's the full workflow.
Practical Examples
Inspecting a JWT payload. Take any JWT and split it at the dots. The second section is the payload — Base64url-encoded JSON. Base64url is a close variant where + becomes - and / becomes _. Paste the payload section into TextForge, decode it, and you'll see the raw claims immediately.
Building a Kubernetes secret. Kubernetes stores secret values as Base64-encoded strings in the manifest data: block. Encode your raw password or API key with TextForge and paste the result directly into your YAML.
Verifying a Basic Auth header. Capture the Authorization header from the DevTools Network tab. Strip the leading Basic prefix, paste the rest into TextForge, decode it, and confirm the username:password pair matches what you expect.
Other Utilities in TextForge
Base64 is one of over 50 functions in the extension. If you spend time manipulating text in the browser, you'll find frequent use for the rest of the toolkit: cleaning whitespace and formatting, converting case, sorting lines, extracting email addresses or URLs from unstructured text, generating UUIDs, and creating slugs from titles. It stays useful well beyond a single use case.
Frequently Asked Questions
Is Base64 encoding the same as encryption?
No. Base64 is an encoding scheme, not encryption. Anyone with the encoded string can decode it instantly without a key. It is used to safely carry binary data through text-only systems, not to hide information.
Is it safe to paste API keys into an online Base64 tool?
Not if the tool sends your data to a server. TextForge runs entirely in your browser as a Chrome extension — your API keys, tokens, and credentials never leave your machine.
What is the difference between Base64 and Base64url?
Base64url is a URL-safe variant that replaces + with - and / with _ to avoid conflicts in URLs and HTTP headers. JWT tokens use Base64url for their header and payload sections.
Does TextForge work offline?
Yes. TextForge processes everything locally in your browser. Base64 encode and decode functions work without an internet connection.
Is the Base64 function free in TextForge?
Yes. Base64 encode and decode are included in the free version of TextForge. No account or subscription is required.
TextForge is free to install. Base64 encode and decode are available in the free version — no account or subscription required.
Install TextForge — free