Skip to main content

Base64 Decode and Encode Toolv1.0.0

Converts text to Base64 and back using a selectable source character set including UTF-8, ASCII, ISO-8859 variants, Windows-1252, UTF-16, and UTF-32. An optional URL-safe alphabet swaps + and / for - and _, and the decoder tolerates missing padding, whitespace, and URL-safe characters without an explicit toggle. Live counters report input bytes, output bytes, and encoded length.

Development
Web
Security
Data Encoding
API
Reference

Documentation

Convert text and files to or from Base64 quickly to support web development, API testing, security reviews, and data embedding. Choose **Encode** to create Base64 strings for HTML, CSS, JSON, or HTTP headers. Choose **Decode** to restore readable text or binary data from Base64, including URL-safe variants used in JWTs and query strings.

Select a mode to encode or decode. Paste text or drop a file into the editor. Toggle URL-safe Base64 when a web context requires - and _ instead of + and /. Choose a character set to interpret decoded bytes correctly, including UTF-8, ISO-8859-1, and Windows-1252. Enable Process each line separately to convert logs and CSV fields line by line. Click Convert or enable Live mode to run conversion automatically. Copy clean results for HTML, JSON, HTTP headers, or data URIs.

Rely on smart handling that accepts missing padding, ignores whitespace, and normalizes URL-safe characters during decode. Confirm limits with live byte counts that display input size, output size, and encoded length.

Generate a data URI by encoding a small SVG or icon, then paste the string into CSS with background-image. Decode a webhook sample to inspect its JSON payload before writing parser logic. Normalize a JWT segment by converting Base64URL to standard Base64 and adding padding when required. Build an HTTP Basic Authorization header by encoding username:password, then prefix with Basic. Convert log fields line by line to validate which records are valid Base64 and which contain errors. Export a short binary snippet as Base64 to move it safely through systems that allow only text.

What is Base64 used for? Use Base64 to represent binary data as text for safe transport in JSON, HTML, URLs, and headers. It prevents corruption from systems that do not handle raw bytes.

What is URL-safe Base64? URL-safe Base64 replaces + and / with - and _ so strings pass through URLs and cookies without encoding issues.

Why do I see padding? Padding with = aligns the output to 4-character blocks. Some systems omit padding, but this tool can add it back during decode.

How do I fix unreadable text after decode? Select the correct character set. Most modern data uses UTF-8. Legacy systems may require ISO-8859-1 or Windows-1252.

Encode with the pipeline text → bytes (charset) → Base64. Decode with Base64 → bytes → text (charset). Use the standard alphabet A-Z a-z 0-9 + / or the URL-safe alphabet A-Z a-z 0-9 - _. Group input bytes into 24-bit blocks, split into four 6-bit indices, map to the alphabet, and apply = padding to reach a multiple of 4. Estimate encoded length with 4 × ceil(n_bytes ÷ 3).

Inputs, outputs, and what the Base64 Decode and Encode Tool computes

The form above accepts the following inputs and produces the outputs listed below. This summary is rendered in the page so the parameters are visible to crawlers, assistive tech, and indexing agents that don't fetch the embedded tool frame.

Inputs

  • Mode · default: Decode
  • Source character set · default: UTF-8
  • Process each line separately
  • Use URL-safe Base64
  • Enable live mode
  • Enable teach mode
  • Input text for conversion
  • Result

Controls

Decode · Reset · Copy result

Worked example

Select a mode to encode or decode.