Tutorial

Base64 to Text Decoder for Developers

Base64 strings look like random characters — a wall of letters, numbers, plus signs, equals signs, and slashes. They appear in JWT tokens, email attachment payloads, data URIs, and API responses. The Base64 to Text decoder converts that encoded string back into readable content without needing to write code. This guide covers where Base64 appears in development work and how to decode it correctly.

Where Developers Encounter Base64

JWT Tokens

JSON Web Tokens (JWT) consist of three Base64-encoded sections separated by dots: header, payload, and signature. The header and payload are Base64-encoded JSON. To inspect the claims inside a JWT — the user ID, expiry time, permissions, or custom fields — decode the middle section (the payload) from Base64. The decoded output is a JSON object with the token's content in readable form.

Example: A JWT payload section might look like eyJ1c2VySWQiOiI4NzMiLCJleHAiOjE3NjA4MDA0MDB9. Decode it and you get {"userId":"873","exp":1760800400}. That tells you immediately who the token belongs to and when it expires, without touching any code.

Email Attachments

Email protocols (SMTP) were designed for ASCII text and cannot natively transmit binary files. MIME encoding solves this by encoding attachment content as Base64 inside the email body. If you look at the raw source of an email with an attachment, the attachment appears as a large block of Base64 text. Decoding it recovers the original file content.

Data URIs for Images

HTML allows embedding images directly into a page using data URIs: src="data:image/png;base64,iVBORw0KGgo...". The Base64 section is the binary image data encoded as text so it can be embedded in an HTML attribute. Decoding the Base64 would give you the raw PNG bytes. Encoding the raw bytes as Base64 gives you content you can use in a data URI.

API Credentials and Authentication

HTTP Basic Authentication encodes credentials as Base64: the username and password are joined with a colon and then Base64-encoded. The Authorization header looks like: Authorization: Basic dXNlcjpwYXNzd29yZA==. Decode that Base64 string and you get user:password. This is how HTTP Basic Auth works — it is not encryption, just encoding, which is why it must always be used over HTTPS.

How to Decode Base64 Step by Step

  1. Copy the Base64 string you want to inspect.
  2. Paste it into the Base64 to Text decoder.
  3. Check the output. If it is readable JSON, text, or structured data, the string contained text content.
  4. If the output is garbled binary characters, the Base64 encodes binary data (an image, a file, compressed content) rather than text.
  5. Use Text to Base64 to encode the decoded text back and confirm the round-trip matches the original input.

Common Decoding Mistakes

  • Confusing Base64 with URL encoding: A URL-encoded string uses percent signs (%20, %26). A Base64 string uses only alphanumeric characters plus signs, and equals signs for padding. They are completely different formats.
  • Incomplete string: Base64 strings must be a multiple of 4 characters (or have proper padding with = signs). Copying only part of a Base64 string produces invalid output.
  • URL-safe variant: Some implementations use URL-safe Base64, which replaces + with - and / with _. If your decoder produces garbled output, check whether the input uses URL-safe variants and try replacing those characters before decoding.

When Decoded Output Is Not Readable

Not every Base64 string contains readable text. Image files, audio data, and binary payloads all produce Base64 that decodes to binary bytes, not human-readable characters. If the decoded output contains non-printable characters or looks like random bytes, the Base64 encoded binary data rather than text. This is normal and expected for image data URIs, file attachments, and encrypted payloads.

Use these tools

Keep exploring the encoding and decoding tools

This post belongs to the encoding cluster. Jump straight into the main tool, then browse related tools and the full hub.

Browse Encoding and Decoding Tools