What is Base64 encoding used for?
Base64 turns any data, including images and other binary files, into plain letters, digits and a few symbols, so it can travel safely through systems that only handle text: JSON and XML payloads, HTTP headers, email attachments, data URIs in HTML or CSS, JWT tokens and PEM certificates.
How do I decode a Base64 string back to text?
Choose Base64 Decode and paste the string. The tool ignores spaces, line breaks and quotes, accepts Base64URL and data: URIs, and shows the text at once. If the Base64 contains a file such as an image or PDF, it shows a preview and a Download button instead.
Why do I get an error when decoding?
The message tells you what is wrong: an invalid character and its position, padding (=) in the middle of the text (usually two strings pasted together), or a length that is impossible for Base64 (usually a string that was cut off when copying). Spaces, line breaks and missing padding are fixed automatically.
What is Base64URL?
Base64URL is a variant that is safe in web addresses and file names. It uses - and _ instead of + and / and usually drops the = padding. JWT tokens use it. Tick URL-safe when encoding; when decoding, the tool detects it automatically.
How do I decode a JWT token?
Open the JWT Decoder tab and paste the whole token (a leading 'Bearer ' is removed). You see the header and payload as formatted JSON, every claim with its meaning, and exp, iat and nbf times as readable dates with an Expired or Not expired status. The signature is not verified, so never trust a token only because it decodes.
How do I convert an image or file to Base64?
Open File → Base64, drop the file or click to choose one (up to 25 MB), then pick the output: plain Base64, a data URI, a CSS url() or an HTML img tag. Copy it or save it as a .txt file. To go back from Base64 to a file, paste it in Base64 Decode and click Download file.
Why is Base64 about 33% larger than the original?
Base64 writes every 3 bytes as 4 characters, so the encoded text is roughly one third larger than the original data, plus line breaks if you wrap it. That is why large images are usually better linked than embedded as data URIs.
Is Base64 encryption? Is it secure?
No. Base64 is an encoding, not encryption: anyone can decode it, no key is needed. Never use it to hide passwords or secrets. To protect data, use real encryption; to store passwords, use a password hashing function such as bcrypt, scrypt or Argon2 on the server.
How do I verify a file's checksum (SHA-256 or MD5)?
Open MD5 / SHA Hash, switch the source to File and choose the file (up to 500 MB). The tool calculates MD5, SHA-1, SHA-256, SHA-384 and SHA-512. Paste the checksum published on the download page into Compare: a green Match means the file is identical, No match means it is different or damaged.
What is the difference between MD5, SHA-1, SHA-256 and SHA-512?
They are one-way hash functions that give a fixed-length fingerprint: MD5 is 32 hex characters, SHA-1 40, SHA-256 64 and SHA-512 128. Collisions have been found for MD5 and SHA-1, so they are only suitable for detecting accidental corruption. Use SHA-256 or SHA-512 when security matters.
Should I use MD5 or SHA-256 to store passwords?
No. Both are designed to be fast, which makes guessing passwords fast too. Store passwords with a slow, salted password hashing algorithm such as Argon2, bcrypt or scrypt. The hashes on this page are for checksums, signatures and testing.
What is HMAC?
HMAC combines a hash function with a secret key. Only someone with the same key can produce the same value, so APIs and webhooks use HMAC-SHA256 to prove that a message is genuine and unchanged. Tick HMAC with secret key and enter the key to calculate it.
Is it safe to paste API keys, tokens or certificates here?
The encoding, decoding and hashing run entirely in your browser with JavaScript; nothing you type or choose is sent to our server or stored. As with any website, browser extensions can read the page, so avoid pasting live production secrets anywhere, and rotate a key if you think it was exposed.
Can I use this Base64 tool on mobile without installing an app?
Yes. Every tab works in the browser on phones, tablets and computers, without downloading or installing anything.
Community Comments