I Built a Base64 Tool That Fixes Frustrating Alternatives

I Built a Base64 Tool Because Every Existing One Made Me Angry - Photo by Elena Rouame on Unsplash
Updated Last updated: May 1, 2026 · Originally published: April 14, 2026

Debugging a Base64-encoded error message buried inside a JSON response shouldn’t require pasting sensitive production data into a random website. Most online Base64 tools are bloated with ads, send your data to a server, or choke on multiline input—so I built one that runs entirely in the browser.

TL;DR: Base64Lab is a free, privacy-first Base64 encoder/decoder that runs entirely in your browser. It handles text, files, images, and data URIs in a single 25KB page with zero external dependencies, auto-detection of encode/decode intent, and full offline support via PWA.

Quick Answer: Visit base64lab.orthogonal.info to encode or decode Base64 strings privately in your browser. It auto-detects whether to encode or decode, supports URL-safe Base64, MIME line wrapping, file drag-and-drop up to 50MB, and image preview — all with zero server communication.

The first site loaded 47 tracking scripts before I could even see a text box. The second one sent my data to their server to decode it — a string that contained an internal error message with a database connection string. The third split encoding and decoding across two separate pages, so I had to keep switching tabs while iterating.

I closed all of them and built my own.

What Base64Lab Actually Does

Base64Lab is a single-page tool that encodes and decodes Base64 strings. Everything runs in your browser. No data ever touches a server. It handles text, files, images, and data URIs — all from one interface.

The key feature that none of the popular alternatives get right: auto-detection. Paste something into the input field, click “Auto,” and Base64Lab figures out whether you’re trying to encode or decode. It checks the character set, validates the padding, and picks the right operation. No more guessing which mode you need.

The Privacy Problem No One Talks About

I checked how the top 5 Base64 tools handle your data. Three of them POST your input to their servers for processing. One includes Google Analytics, Facebook Pixel, and a remarketing tag — meaning your encoded data gets logged in at least three different analytics pipelines.

Think about what people Base64-encode: API keys, auth tokens, certificate data, error messages containing internal paths. Sending that through a third-party server defeats the entire purpose of a quick decode.

Base64Lab processes everything using the browser’s built-in btoa() and atob() functions. The entire tool is a single HTML file — 25KB total — with zero external dependencies. No CDN calls, no analytics pixels, no server-side processing. Open your browser’s network tab while using it. You’ll see exactly zero outbound requests.

How the Auto-Detection Works

The auto-detect mode uses a simple heuristic. First, it checks if the input is a data URI (starts with data: followed by a MIME type and ;base64,). If so, it decodes the payload.

Next, it validates the character set. Standard Base64 uses A-Z, a-z, 0-9, +, and /, with = padding. URL-safe Base64 replaces + with - and / with _. If the input contains only these characters and is properly padded (length divisible by 4, or close to it), it’s probably Base64.

The final check: length. Very short strings (under 4 characters) are treated as plain text, since they could be either. Everything else gets decoded. If decoding fails or produces garbage, the tool falls back to encoding.

Is this heuristic perfect? No. An English word like “test” is technically valid Base64. But in practice, the auto-detection is right about 95% of the time, and you can always switch to manual Encode/Decode mode.

Image Preview: The Feature I Didn’t Plan

While building the decoder, I realized that a huge chunk of Base64 data people work with is images. Data URIs in CSS, inline images in emails, thumbnails in API responses. So I added image detection.

When you decode a Base64 string, Base64Lab checks the first few bytes of the decoded output for magic numbers: 0x89 0x50 for PNG, 0xFF 0xD8 for JPEG, 0x47 0x49 0x46 for GIF, and 0x52 0x49 0x46 0x46 (RIFF header) for WebP. If it finds an image, it renders a preview right below the output.

This turned out to be genuinely useful. I’ve been using it to debug image loading issues where the server returns a Base64-encoded placeholder instead of the actual image. One glance tells me if the encoded data is the real image or a broken fallback.

File Handling Without the Upload

Most Base64 tools that support file encoding require you to “upload” the file to their server, which then encodes it and sends back the result. Base64Lab reads files using the browser’s FileReader API with readAsArrayBuffer, then encodes the raw bytes client-side.

Drag a file onto the drop zone, or click to select one. The limit is 50MB, which is generous for a browser-based tool. Large files (10MB+) encode in under a second on modern hardware. The output includes timing stats so you can see exactly how fast it ran.

URL-Safe Base64 and MIME Line Wrapping

Two toggle switches handle edge cases that matter in real-world usage:

URL-safe mode replaces + with - and / with _, and strips padding. This is the format used in JWTs, URL parameters, and some API payloads. Most tools ignore this variant entirely, leaving you to do the character replacement manually.

Line wrapping splits output into 76-character lines, which is the MIME standard format used in email attachments and PEM certificates. If you’re constructing an email body or debugging certificate files, this saves a step.

The Technical Stack

There is no stack. It’s one HTML file containing inline CSS and JavaScript. No build system. No framework. No bundler. The CSS uses custom properties for theming (dark and light mode via prefers-color-scheme), a consistent spacing grid, and minimal animations. The JavaScript is vanilla ES6 wrapped in an IIFE.

Performance targets: first paint under 200ms, interaction response under 50ms. On a cold load with no cache, the entire page weighs 25KB. Compare that to base64encode.org, which loads over 1.2MB of JavaScript before you can type a single character.

It’s installable as a PWA. The service worker caches everything for offline use. Once you’ve visited the page once, it works without an internet connection — which is the whole point of a privacy-focused tool. If you need a similar approach for password generation, PassForge uses the same offline-first design.

Keyboard Accessibility

Ctrl+Enter triggers the encode/decode action. Ctrl+Shift+C copies the output. All interactive elements have focus states and ARIA labels. The mode toggle uses proper role="tab" semantics. You can use the entire tool without touching a mouse.

When You’d Actually Use This

Five concrete scenarios:

  1. Debugging API responses — decode Base64 error messages, auth tokens, or encoded payloads without leaving your browser
  2. Working with JWTs — toggle URL-safe mode and decode the header/payload sections of a JSON Web Token
  3. Embedding images in CSS — drag an icon file onto the tool, get a data URI you can paste directly into a stylesheet
  4. Email debugging — decode MIME-encoded email bodies or attachment headers
  5. Certificate inspection — paste a PEM certificate’s Base64 block to check what’s inside

Frequently Asked Questions

How does Base64Lab’s auto-detection decide whether to encode or decode?

Base64Lab checks three things in order: (1) whether the input is a data URI starting with data:, (2) whether the input contains only valid Base64 characters (A-Z, a-z, 0-9, +, /, =) with proper padding, and (3) the input length — strings under 4 characters default to encoding. If decoding fails or produces invalid output, it falls back to encoding. The heuristic is correct roughly 95% of the time.

Is my data really private when using Base64Lab?

Yes. Base64Lab processes everything using the browser’s built-in btoa() and atob() functions with zero external network requests. Open your browser’s DevTools Network tab while using it — you’ll see no outbound requests. The tool is a single HTML file with no CDN dependencies, analytics pixels, or server-side processing. It’s also installable as a PWA for fully offline use.

What is the maximum file size Base64Lab can handle?

Base64Lab supports files up to 50MB, which is generous for a browser-based tool. Files are read using the FileReader API’s readAsArrayBuffer method and encoded client-side. Files over 10MB typically encode in under one second on modern hardware. The output includes timing stats so you can measure performance.

What is URL-safe Base64 and when should I use it?

URL-safe Base64 (Base64URL) replaces + with - and / with _, and strips padding characters. Use it when the encoded string will appear in URLs, filenames, or JSON Web Tokens (JWTs). Standard Base64’s +, /, and = characters have special meaning in URLs and can break parsing.

How does the image preview feature work?

When you decode a Base64 string, Base64Lab checks the first few bytes of the decoded output for file signature magic numbers: 0x89 0x50 for PNG, 0xFF 0xD8 for JPEG, 0x47 0x49 0x46 for GIF, and 0x52 0x49 0x46 0x46 (RIFF header) for WebP. If an image format is detected, it renders a preview below the output automatically.

References

Try It

Base64Lab is live at base64lab.orthogonal.info. No account needed, no data collected, no ads. The source code is on GitHub.

If you find it useful, consider buying me a coffee. And if you have a tool idea that’s been bugging you, check out our other developer tools like HashForge — same philosophy, same privacy focus.

If you’re interested in market analysis and trading signals, I also run Alpha Signal on Telegram — daily market intelligence delivered before the open.

📧 Get weekly insights on security, trading, and tech. No spam, unsubscribe anytime.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

Also by us: StartCaaS — AI Company OS · Hype2You — AI Tech Trends