New Livestream: OWASP Top 10 2025 Explained for .NET Developers.

Register Now!
Developer Tools

Base64 Decoder & Encoder

Decode and encode Base64 and Base64URL online, converting Base64 to text and back for strings or files, with correct UTF-8 handling.

Mode
Variant

Avoid pasting live secrets or production tokens here.

This looks like a JWT. Open the JWT decoder to inspect its header, payload, and signature.

Output appears here.

What is Base64?

Base64 is a binary-to-text encoding that represents arbitrary bytes using 64 printable ASCII characters (A-Z, a-z, 0-9, '+', '/'), with '=' padding so the output length is always a multiple of 4. It's used wherever binary data needs to travel through text-only channels, such as email attachments, data URLs, and JSON/JWT payloads. Because Base64 can represent any bytes, decoding binary data (an image, a compressed file, encrypted bytes) won't produce valid UTF-8 text, so this tool shows a hex dump of the decoded bytes instead. You can also encode a file directly (up to 5MB) using the browser's FileReader API.

Base64 vs. Base64URL: why do JWTs use the URL-safe flavor?

Base64URL swaps '+' for '-' and '/' for '_', and conventionally drops '=' padding, producing output that's safe to embed directly in a URL, filename, or HTTP header without percent-encoding. JWTs (see what is a JWT and how does it work) are base64url-encoded for exactly this reason. Try the JWT decoder to see it in action.

Is Base64 the same as encryption?

No, Base64 is an encoding, not encryption. It is fully and instantly reversible by anyone, with no secret key involved. See security lingo explained: encode vs. encrypt vs. hash for the distinction. Never rely on Base64 alone to keep data confidential.

Encoding/decoding Base64 and Base64URL in .NET

.NET has had Convert.ToBase64String / Convert.FromBase64String for standard Base64 for a long time. For Base64URL, .NET 9 added a dedicated System.Buffers.Text.Base64Url type so you don't have to hand-roll the character substitution and padding yourself:

Csharp

using System.Buffers.Text;

byte[] bytes = Encoding.UTF8.GetBytes("hello world");

// Standard Base64
string standard = Convert.ToBase64String(bytes);

// Base64URL (.NET 9+), the flavor JWTs use
string urlSafe = Base64Url.EncodeToString(bytes);
byte[] roundTrip = Base64Url.DecodeFromChars(urlSafe);
  • JWT Decoder

    Decode, inspect and verify JWTs with claim explanations, expiry checks and signature verification.

  • PKCE Generator

    Generate a code_verifier and code_challenge pair for OAuth 2.0/2.1 PKCE flows, plus state, nonce and example requests.

  • URL Decoder & Encoder

    Encode/decode URLs and percent-encoding, and parse OAuth/OIDC redirect query strings.

Build on Duende IdentityServer

The OpenID Connect and OAuth 2.0 framework for ASP.NET Core, from the team that built this tool.