Base64 Decoder Online: Decode Text, Files, Images and JWT Tokens

Base64 decoding converts a Base64 string back into its original text or file. This free Base64 decoder gives you three tools on one page: decode Base64 to text, rebuild an image or file from Base64 or a Data URI, and break a JWT into a readable header and payload with an automatic expiry check. If decoding fails, it tells you what to fix. Everything runs in your browser, so your data is not uploaded.

Free · No sign-up · Runs in your browser · Last updated: November 2026

Live · Private · Nothing uploaded

Related Tools

What Makes This Base64 Decoder Different

Most Base64 decoders only turn a string into text. This one is built for the jobs developers and testers actually run into:

  • Three decoders in one page. Switch between Decode Text, Decode File and Decode JWT. No need to open a different tool for each job.
  • JWT inspection with an automatic expiry check. The header and payload appear as readable JSON. The exp claim is converted into a date and compared with the current time, so you immediately see whether the token is valid or expired.
  • Errors that tell you what to fix. Instead of a vague "invalid input", you get a pointer to the likely cause, such as turning on URL-safe input.
  • Rebuild files with an image preview. Paste raw Base64 or a full Data URI, let the type be detected from the Data URI or choose it yourself, name the file, preview images, and download.
  • URL-safe input and batch mode. Decode tokens that use - and _, or decode a whole list of values one per line.
  • Messy input is fine. Spaces and line breaks in pasted Base64 are stripped automatically.
  • Private by design. Decoding happens in your browser using JavaScript, so pasted tokens and files are not sent to a server.

How to Decode Base64 Online

Decode Text

  1. Paste your Base64 string into the input box.
  2. Turn on URL-safe input if the string contains - or _.
  3. Click Decode Text to see the original text.

Decode File or Image

  1. Paste a Base64 string or a full Data URI.
  2. Choose the file type, or let it be detected from the Data URI.
  3. Name your file and click Decode & Download. Images show a preview first.

Decode JWT

  1. Paste the full token (three parts separated by dots).
  2. Read the decoded header and payload.
  3. Check the expiry status shown for the exp claim.
base64 decoder tool showing decoded JWT header and payload with expiry status

How Base64 Decoding Works

Decoding reverses Base64 encoding. The decoder takes the string four characters at a time, turns each character back into a 6-bit value, and joins them into three bytes. Trailing = padding is ignored. The result is raw bytes. If those bytes are text, they are read as readable characters (usually UTF-8). If they are a file such as an image or PDF, they need to be saved as that file type instead.

Base64 Decoding Examples

Paste any of these into the decoder to check the result.

Base64 inputDecoded outputNote
SGVsbG8gV29ybGQhHello World!Plain text
SGVsbG8sIFdvcmxkIQ==Hello, World!Ends with = padding
aGVsbG8_d29ybGQ-Pghello?world>>URL-safe input must be ON
Y2Fmw6k=caféAccented letters use UTF-8 bytes
QWxhZGRpbjpvcGVuIHNlc2FtZQ==Aladdin:open sesameLooks like HTTP Basic Auth (username:password)

How to Convert Base64 to an Image or File

Use the Decode File tab. Paste the Base64 string, or a full Data URI such as data:image/png;base64,iVBORw0KGgo.... A Data URI carries the file type, so it is detected for you. A raw Base64 string has no header, so choose the type from the dropdown.

If you are not sure what a raw string contains, its first characters usually give it away:

Starts withFile type
/9j/JPEG image
iVBORw0KGgoPNG image
R0lGODGIF image
UklGRWebP image (a RIFF file, also used by WAV and AVI)
JVBERi0PDF document
UEsDBZIP archive (also DOCX, XLSX and PPTX files)
H4sIGZIP data

Choose the matching type, name your file, and download it. If the string is an image, you will see a preview before saving.

How to Decode a JWT and Check Its Expiry

A JWT (JSON Web Token) has three parts separated by dots: a header, a payload and a signature. The first two are Base64URL-encoded JSON, so they can be read without any key. Paste a full token into the Decode JWT tab and you get:

  • Header: the token type and signing algorithm, such as HS256 or RS256.
  • Payload: the claims, such as the user, issue time and expiry time.
  • Expiry status: the exp claim is converted into a readable date and compared with the current time, so you can see if the token is still valid or expired. If a token has no exp claim, no status is shown, rather than a false one.

Here is a demo token you can try. It is made-up data, and its signature is not real:

eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkphbmUgRG9lIiwicm9sZSI6ImFkbWluIiwiaWF0IjoxNzAwMDAwMDAwLCJleHAiOjE3MDAwMDM2MDB9.c2lnbmF0dXJlLWRlbW8

The payload decodes to {"sub":"1234567890","name":"Jane Doe","role":"admin","iat":1700000000,"exp":1700003600}. The exp value 1700003600 is 14 November 2023, 23:13:20 UTC. That time has passed, so the decoder marks this token as expired.

Common JWT Claims

These registered claims are defined in RFC 7519. Times are Unix timestamps in seconds.

ClaimMeaning
issIssuer: who created the token
subSubject: who the token is about
audAudience: who the token is meant for
expExpiration time: the token is invalid after this moment
nbfNot before: the token is invalid before this moment
iatIssued at: when the token was created
jtiJWT ID: a unique identifier for the token

Decoding Is Not Verifying

This decoder shows you what a token contains. It does not verify the signature, because that requires the secret or public key. A decoded token is not proof that the token is genuine, so always verify signatures on your server or with a trusted library.

Anyone who holds a JWT can read its payload, so tokens should never carry passwords or private data. The JWT.io introduction explains the structure in more detail.

Fixing Base64 Decode Errors

When a string will not decode, it is almost always one of these:

ProblemLikely causeFix
Invalid character errorThe string uses - and _ (URL-safe Base64)Turn on URL-safe input
Incorrect paddingThe trailing = characters were cut offCopy the complete string, including any = at the end
Garbled text like "café"The text was read with the wrong character encodingMake sure the original text was UTF-8 encoded
Random symbols or unreadable outputThe data is a file (image, PDF, ZIP), not textUse the Decode File tab
JWT will not decodeThe token is incomplete, or has extra text such as "Bearer " in frontPaste only the token: three parts separated by two dots
Nothing happensThe input is empty or is not Base64Check that you pasted the encoded string, not the original data

How to tell if a string is Base64: it uses only A–Z, a–z, 0–9, + and / (or - and _ in URL-safe form), its length is a multiple of 4, and it may end with one or two = characters. Spaces and line breaks are removed automatically by this decoder.

URL-Safe Input and Batch Mode

URL-safe input is for Base64URL strings that use - and _ instead of + and /. You will see them in JWTs, URL parameters and some API tokens. With the option off, those characters are treated as invalid.

Batch mode decodes each line separately instead of treating the whole input as one string. Use it when you have a list of separately encoded values, such as several IDs or tokens, and want to decode them in one go.

Frequently Asked Questions

How do I decode Base64 online?

Open the Decode Text tab, paste your Base64 string, turn on URL-safe input if it contains - and _, and click Decode Text. The original text appears instantly. For files or images, use the Decode File tab. Everything runs in your browser.

How do I decode a JWT and check if it has expired?

Open the Decode JWT tab and paste the full token. The decoder shows the header and payload as readable JSON, converts the exp claim into a date, and tells you whether the token is valid or expired. If the token has no exp claim, no status is shown.

Can this decoder verify a JWT signature?

No. It decodes the header and payload only. Verifying a signature needs the secret or public key and should be done by your server or a trusted library. A decoded token shows what it contains, not whether it is genuine.

How do I convert Base64 to an image or PDF?

Open the Decode File tab, paste the Base64 string or a full Data URI, choose the file type (it is detected from a Data URI), name the file, and click Decode & Download. Images show a preview first.

Why do I get an "invalid character" or "incorrect padding" error?

Invalid character usually means the string is URL-safe Base64 with - and _, so turn on URL-safe input. Incorrect padding means the trailing = characters were cut off, so copy the complete string again.

Is it safe to paste a JWT or API token into an online decoder?

This decoder runs in your browser and does not upload your input, but you should still be careful with live tokens. Anyone who holds a JWT can read its payload, so prefer test or expired tokens and never post real ones publicly.

Why does my decoded text look garbled?

Garbled characters such as "café" usually mean the text was read with the wrong character encoding, or the data is not text at all. If the Base64 holds an image, PDF or ZIP, use the Decode File tab instead of Decode Text.

Quick Summary

This Base64 decoder converts Base64 back into text, files, or JWT tokens — all processed locally in your browser. Unlike a basic Base64 decoder that only handles plain text, this one reconstructs files with image preview, decodes JWTs into readable header and payload sections, and automatically checks token expiry. Helpful error messages point you toward the fix — like enabling URL-safe mode — instead of just saying "invalid input." Nothing you paste is ever uploaded, which matters since Base64 decoding is often used on sensitive data like authentication tokens.

Disclaimer

This tool decodes and displays data as-is. It does not verify JWT signatures or confirm that decoded data is safe or genuine, so please check tokens and files before relying on them in a live system.

Scroll to Top