DevConverter
JSON & Data
Encoding & Decoding
Security & Crypto
Text Utilities
Time & Date
Utilities
Blog
Categories
Encoding & Decoding
Base64 Encoder / Decoder

Base64 Encoder / Decoder

Encode to Base64 or decode Base64 to text — supports Base64URL (JWT), UTF-8/Latin1, padding toggle, and auto-detect.

Text (Plain)
Auto-detect: paste text or Base64
Input
Mode
Encoding
Base64 (Encoded)
Spacer
Output

What is Base64 Encoder / Decoder?

Base64 Encoder / Decoder is a developer tool for converting between plain text and Base64, plus Base64URL (the URL-safe variant used by JWT). Base64 represents binary data as ASCII text so it can safely pass through text-only channels like JSON, HTTP headers, query strings, environment variables, and configuration files. This tool supports UTF-8 (recommended for Unicode like Hebrew/emoji) and Binary (Latin1) for legacy `atob`/`btoa` compatibility. You can also control padding (`=`) because some ecosystems require it, while JWT/Base64URL often omits it. Use it to debug encoded API fields, inspect JWT segments, validate whether a string is Base64, and generate safe encoded values for apps and scripts—entirely in your browser.

How to Use

1

Paste plain text to encode or a Base64/Base64URL string to decode

2

Auto-detect chooses Encoding vs Decoding (you can override by swapping if needed)

3

Select UTF-8 for modern text (recommended) or Binary (Latin1) for legacy compatibility

4

Enable Base64URL (JWT) when working with URL-safe tokens (uses - and _ instead of + and /)

5

Toggle “Without padding” if your target system expects no '=' padding (common for Base64URL/JWT segments)

6

Copy the output and use it in headers, payloads, configs, tests, or scripts

Common Use Cases

Decode Base64 fields from API responses, logs, and database records

Encode JSON or config blobs for environment variables (single-line transport)

Decode JWT header/payload segments (Base64URL) for debugging auth issues

Generate URL-safe identifiers for query params or filenames (Base64URL mode)

Create HTTP Basic Auth values (Base64 of username:password)

Validate whether an input is valid Base64/Base64URL before parsing in code

Troubleshoot broken Unicode output by switching UTF-8 vs Binary mode

Prepare Base64 test fixtures for unit/integration tests

Key Features

All-in-one Base64 encode + decode

One tool for both directions

Base64URL (JWT) mode

URL-safe alphabet (- and _) for tokens and URLs

Padding control

Keep '=' for strict decoders or remove it for JWT/Base64URL use

UTF-8 support

Correct handling for Unicode text (Hebrew, emoji, accents)

Binary (Latin1) mode

Matches legacy `atob`/`btoa` expectations when needed

Auto-detect workflow

Paste anything and the tool chooses the likely direction

Fast local processing

Runs in-browser (no uploads), great for sensitive data

Copy-friendly output + examples

Designed for day-to-day dev debugging

Related Articles

Learn more about this tool with our in-depth guides

Base64 Encoding and Decoding: Complete Developer Guide
Jan 6, 2025•8 min read

Base64 Encoding and Decoding: Complete Developer Guide

Master Base64 encoding and decoding with practical examples. Learn when to use it, common pitfalls, and best practices for handling binary data.

#base64#encoding#data-conversion+2

Quick Examples

Try these to get started

Encode simple text → Base64

Convert plain text into Base64 for safe transport.

Hello, World!

Decode Base64 → text

Decode a standard Base64 string back into readable text.

SGVsbG8sIFdvcmxkIQ==

Encode Unicode text (UTF-8)

UTF-8 preserves Unicode characters correctly (Hebrew/emoji/accents).

שלום 👋 — café

Encode JSON for APIs/configs

Encode a JSON string for env vars, config fields, or text-only systems.

{"env":"prod","flags":{"newUI":true},"region":"eu-west-1"}

HTTP Basic Auth credential (username:password)

Encode `username:password` for the Authorization header (prefix with `Basic `).

username:password

Decode a JWT header segment (Base64URL)

Decode a JWT header segment. Enable Base64URL mode if needed (JWT uses Base64URL).

eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9

Decode a JWT payload segment (Base64URL)

Inspect JWT claims quickly by decoding the payload segment (Base64URL).

eyJzdWIiOiJ1c2VyXzEyMyIsInNjb3BlIjoicmVhZDp1c2VycyJ9

URL-safe token (Base64URL + optional no padding)

Enable Base64URL (and optionally remove padding) for URL-safe tokens.

user:12345|role:admin|ts:1700000000

Multiline value (store as single line)

Base64 is useful for storing multiline values as a single-line string in env vars.

-----BEGIN KEY-----
line1
line2
-----END KEY-----

Detect invalid Base64 quickly (bad characters)

Validation should fail when illegal Base64 characters appear (like '$').

SGVsbG8$IFdvcmxkIQ==

Common Questions

Find answers quickly

Popular conversions

You might also need

Base64 Encode

Encode text to Base64 instantly (UTF-8). Create Base64 strings for APIs, configs, Basic Auth, and safe text transport — locally in your browser.

Base64 Decode

Decode Base64 strings to readable text instantly with UTF-8 support

Base64URL Encode

Encode text to URL-safe Base64URL format for JWTs and URLs

Base64URL Decode

Decode Base64URL strings from JWTs and URLs to readable text

Text to Base64

Convert plain text to Base64 encoding instantly

Base64 to Text

Convert Base64 encoding back to readable plain text

URL Encoder & Decoder

Encode or decode URL strings and query parameters using percent-encoding (UTF-8)

HTML Escape & Unescape

Escape HTML characters into entities or unescape entities back to text (safe for XSS-sensitive output)

JWT Decoder

Decode JWT tokens locally to inspect header + payload claims (exp/nbf/iat, iss/aud, scopes/roles) and debug OAuth2/OIDC authentication issues.

JSON Formatter & Validator

Format, validate, beautify, and minify JSON — instantly detect errors and debug API payloads safely in your browser.

DevConverter

Free, fast, and secure online developer tools. All processing happens in your browser for complete privacy.

DevConverter GitHub RepositoryDevConverter LinkedIn ProfileEmail DevConverter

Popular Tools

  • JSON Formatter
  • Base64 Encoder
  • JWT Decoder
  • Hash Generator

Categories

  • JSON & Data
  • Encoding & Decoding
  • Security & Crypto
  • Text Utilities
  • Time & Date
  • Utilities

Company

  • About Us
  • Blog
  • FAQ
  • Privacy Policy
  • Terms of Service
  • Contact
© 2026 DevConverter. All rights reserved.
Made with ❤️ for developers worldwide