Two of the most common reasons to decode Base64: checking what is inside a JWT token and reading Kubernetes secret values. This guide covers both with step-by-step examples.
A JWT (JSON Web Token) looks like this:
eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyIjoiam9obiIsInJvbGUiOiJhZG1pbiJ9.signature
Three segments separated by dots:
You can decode segments 1 and 2 without any key. They are just Base64url-encoded JSON.
eyJ1c2VyIjoiam9obiIsInJvbGUiOiJhZG1pbiJ9{"user":"john","role":"admin"}For a full JWT breakdown with all three segments parsed and formatted, use the JWT Decoder.
| Claim | Example | Meaning |
|---|---|---|
| sub | 12345 | Subject (user ID) |
| exp | 1712345678 | Expiration (Unix timestamp) |
| iat | 1712340000 | Issued at time |
| role | admin | User role/permissions |
| [email protected] | User email | |
| iss | auth.example.com | Token issuer |
Check the exp claim to see if a token has expired. Convert the Unix timestamp with the Timestamp Converter.
Decode JWT payloads and Base64 strings instantly.
Decode Now →When you get a Kubernetes secret:
apiVersion: v1 kind: Secret metadata: name: db-credentials data: username: YWRtaW4= password: czNjcjN0UEBzc3cwcmQ=
The values are Base64. Decode them:
YWRtaW4= → adminczNjcjN0UEBzc3cwcmQ= → s3cr3tP@ssw0rdkubectl get secret db-credentials -o jsonpath='{.data.password}' | base64 -dkubectl get secret db-credentials -o json | jq -r '.data | to_entries[] | "\(.key): \(.value | @base64d)"'YAML is a text format. Binary values (certificates, keys) cannot be stored directly. Base64 converts them to text. But Base64 is NOT security. Anyone with kubectl access can decode the values. Use Sealed Secrets, SOPS, Vault, or external secret managers for real protection.
Both JWTs and Kubernetes secrets use Base64 for format compatibility, not security. A Base64-encoded password is not a protected password. Always:
Related: JWT Decoder, Hash Generator, URL Encoder.