Get a Pentest and security assessment of your IT network.

Cyber Security

Decode Base64 Payload

TL;DR

This guide shows you how to decode a string encoded in Base64 and check if the decoded result looks like useful data (e.g., text, JSON, or a common file format). We’ll cover online tools and command-line methods.

Steps

  1. Understand Base64
  2. Base64 is a way to represent binary data as ASCII characters. It’s often used when you need to send files or other non-text data through systems that only handle text. Decoding turns the Base64 string back into its original form.

  3. Online Decoder
  4. The easiest way is using an online decoder:

    • Go to a website like Base64 Decode or similar.
    • Paste your Base64 string into the input box.
    • Click “Decode”.
    • Examine the output. Does it look like readable text, JSON data, or something else meaningful?
  5. Command Line (Linux/macOS)
  6. If you’re comfortable with the command line, use this:

    base64 -d <your_base64_string>

    For example:

    echo "SGVsbG8gd29ybGQh" | base64 -d

    This will output: Hello world!

  7. Command Line (Windows)
  8. PowerShell can decode Base64:

    [System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String(""))

    For example:

    [System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String("SGVsbG8gd29ybGQh"))

    This will output: Hello world!

  9. Check the Output Type
    • Text: If it’s readable English (or another language), you’ve likely decoded something useful.
    • JSON: Look for curly braces {...} and square brackets [...]. You can use a JSON validator to check if the output is valid JSON. Many online validators are available, such as JSONLint.
    • File Header: If it starts with recognisable file headers (e.g., PK for ZIP files, GIF89a for GIFs), you’ve likely decoded a binary file. You can try saving the output to a file and opening it with the appropriate application.
    • Garbage: If it’s just random characters, the Base64 string might be invalid or not what you expect. It could also be encrypted data requiring further steps.
  10. Multiple Decodes (Rare)
  11. Sometimes a string is encoded multiple times. Try decoding it several times in a row. This is uncommon, but worth trying if the first decode doesn’t produce anything meaningful.

Related posts
Cyber Security

Zip Codes & PII: Are They Personal Data?

Cyber Security

Zero-Day Vulnerabilities: User Defence Guide

Cyber Security

Zero Knowledge Voting with Trusted Server

Cyber Security

ZeroNet: 51% Attack Risks & Mitigation