Tool guide

Base64 Lab documentation

Encode or decode payloads with wrapping presets, URL-safe toggles, and binary-aware previews made for web and CLI workflows.

Last updated November 30, 2025

Why this tool exists

The Base64 Lab keeps encode/decode workflows in one place with presets for URL-safe alphabets, RFC-style wrapping, whitespace normalization, and binary-aware previews.

API tokens & headers

Encode `client_id:secret` pairs or JSON payloads before shipping them through curl, Postman, or task runners.

Wrapped payload cleanup

Normalize Base64 copied from terminals, logs, or emails by stripping whitespace and re-wrapping to 64 or 76 characters.

Binary inspection

Decode blobs to confirm contents; when bytes show up we render a hex preview so you can validate attachments safely.

Quick start

Pick a mode, tweak alphabet or wrapping, run the request, and copy the normalized payload without touching your terminal.

  1. Open the Base64 Lab from the tools directory and pick Encode or Decode before pasting data so the correct controls unlock.
  2. Adjust the alphabet, wrapping, padding, or whitespace toggles to match your target environment—load a quick sample if you need inspiration.
  3. Submit the form to run everything server-side, then copy the rendered output or one of the provided code snippets.

Supported inputs

  • Accepts UTF-8 text, JSON, or CLI strings for encoding—payloads stay on the server so large blobs remain fast.
  • Decoding tolerates whitespace, tabs, and line breaks; enable “Strip whitespace” to normalize wrapped payloads first.
  • URL-safe tokens using -_ are supported, and auto-padding can append `=` characters when upstream services omit them.

Mode 01

Encode workflow

  1. Switch to Encode mode and paste raw text or one of the preset samples to bootstrap your session.
  2. Set the wrapping behavior to None, 64 characters, or RFC 2045-friendly 76 characters so the output matches CLI or email expectations.
  3. Toggle the alphabet button to move between Standard (+ /) and URL-safe (- _) variants without editing your input.
  4. Decide whether to strip trailing padding before sharing tokens. Submit to generate wrapped lines plus copy-ready output and snippets.

Mode 02

Decode workflow

  1. Choose Decode mode and paste any Base64 string—line breaks, tabs, and spaces are fine if “Strip whitespace” is on.
  2. Enable URL-safe alphabet if the input uses -_. The lab automatically translates to +/ behind the scenes before decoding.
  3. Auto-pad fixes payloads that arrive without enough `=` characters, preventing manual edits for quick investigations.
  4. When the decoded data is binary we show a hex preview and change the copy button to Base64 so you can move the bytes without corrupting them.

Controls & presets

Quick samples, wrap presets, and alphabet toggles expose every knob you need while mirrors of each setting show up in the insights card.

  • Quick samples are grouped by mode, so each preset loads the right alphabet, wrap option, and whitespace settings in one click.
  • Wrap options rely on server-side chunking which means even long payloads stay accurate compared to local terminal tooling.
  • Alphabet, padding, and whitespace toggles double as documentation—each option reflects back inside the insights card after every run.

Outputs, insights & snippets

Status badges, binary warnings, and stats keep every run transparent while curated snippets mirror what you would do in PHP or the shell.

  • Status badges swap between “Encoding ready”, “Decoded successfully”, or “Invalid Base64 input” so you always know what happened.
  • Binary results trigger a caution block explaining what was detected plus the exact hex preview for the first bytes.
  • The insights card tracks alphabet, input length, output length, wrap preset, whitespace stripping, and padding actions by mode.

Snippet references

PHP encode

Use `Str::toBase64()` or `base64_encode` for quick token generation.

PHP decode

Call `base64_decode($input, true)` to mimic the strict validation the lab performs.

Linux shell encode

Pipe text through `openssl base64` to reproduce wrapped output.

Linux shell decode

Use `openssl base64 -d` for parity with the Decode workflow.

Field notes

Lightweight habits that keep Base64 conversions predictable during audits or incident response.

  • Toggle URL-safe mode before copying anything meant for OAuth, JWTs, or linkable tokens to avoid unnecessary replacements.
  • Leave padding on unless a spec explicitly calls for trimmed equals; some APIs reject stripped payloads.
  • When cleaning Base64 from logs or emails, enable both Strip whitespace and Auto-pad so you can paste in messy blobs without edits.
  • Pair the snippets with the Encoding + Escape Lab if you need to sanitize the decoded payload for HTML or JSON contexts afterward.
Pair this lab with the Encoding + Escape documentation whenever you need to sanitize the decoded payload. Jump back to the documentation hub anytime or follow the “View documentation” link in the Base64 Lab hero on the tools page.

Builder wisdom

“Every time you write new code, you create new potential bugs.”

— Unknown

Quick links

© 2025 OVRO Tools · tools for everyone.