Encode and decode text, files and JSON as base64, base64url or hex as you type, with a check that every result decodes back exactly.
Initializing in your browser…
Percent-encode and decode URLs as you type in four character sets, build query strings, and take any URL apart parameter by parameter.
Decode a JSON Web Token instantly, check its expiry and claims, and verify the signature with a secret, PEM key or JWKS, all in your browser.
Convert between binary, octal, decimal, hex and any base to 36 exactly at any size, with bitwise operations, IEEE-754 floats and an ASCII table.
A JSON field only accepts ASCII, and the label you need to store has an accent, an emoji and a currency sign in it.
Text to encode
café ☕ 5€
Base64
Standard Y2Fmw6kg4piVIDXigqw= URL-safe Y2Fmw6kg4piVIDXigqw 9 characters, 14 bytes as UTF-8 20 characters out, 143% of the input Decodes back to the input exactly
Base64 works on bytes, not characters. The nine characters are 14 bytes in UTF-8: one each for c, a, f, the two spaces and the 5, two for é, and three each for the coffee cup and the euro sign. Fourteen bytes are four full groups of three with two bytes left over, so the output is five groups of four characters, and the last group ends with one = to show it carries only two bytes. The URL-safe form drops that padding and is one character shorter. Neither string contains + or /, so the two alphabets agree everywhere else. Paste either one back in with Decode and the original text returns, because the bytes are valid UTF-8.
Base64 turns any data into plain letters, digits and a few symbols so it can travel through places that only accept text, such as JSON fields, email bodies, HTTP headers and URLs. This tool encodes and decodes text, files and JSON as you type, in the standard alphabet, the URL-safe one, or hex, and confirms that every result decodes back to exactly what you started with.
Base64 writes binary data using 64 printable characters: A to Z, a to z, 0 to 9, plus and slash. Every three bytes become four characters, so encoded data is about a third larger than the original, and one or two equals signs pad the end when the length is not a multiple of three. That size cost is the main reason to use it sparingly. A 30 kB icon becomes roughly 40 kB of text inside your HTML, and inline data cannot be cached by the browser the way a separate file can.
Text is encoded from its UTF-8 bytes, which is what other systems expect. A plain ASCII letter is one byte, an accented letter two, the euro sign three and most emoji four, so the counter under the input shows both characters and bytes. Decoding is where tools tend to go wrong without telling you. If the bytes are not valid UTF-8, a text decoder swaps them for the U+FFFD replacement symbol and carries on. This tool checks, warns you when the result is not really text, and still lets you download the true bytes.
Standard base64 and the URL-safe variant defined in RFC 4648 differ in two characters: URL-safe uses a hyphen and an underscore in place of plus and slash, and usually leaves out the padding. JSON Web Tokens and many web APIs use it. When decoding you do not need to say which one you have. The tool reads either, puts back any missing padding, ignores spaces and line breaks, and accepts a complete data: URL. The alphabet setting only changes what encoding produces.
When a string cannot be decoded you get the reason rather than a generic failure: characters outside the alphabet (listed by name), padding in the middle, more than two padding characters, or a length no valid base64 can have, which is one more than a multiple of four. When encoding, the tool decodes its own output again and compares it with your input byte for byte, and the line under the result confirms the match.
File mode reads the file on your device and produces plain base64 or a data: URL carrying the file's MIME type. Decoded files are saved with an extension chosen from their content, so a PNG comes back as decoded.png instead of an anonymous .bin. JSON mode checks the input is valid, strips formatting whitespace when encoding and indents the result when decoding, without re-reading the numbers, so a 20-digit ID keeps every digit. Keep in mind that base64 is not encryption. Anyone can decode it, so it should never be used to hide a password or a key.
Encode an icon or a subset font in File mode and paste the data: URL straight into CSS or an img tag, saving one request for an asset too small to be worth it.
Many APIs take attachments as a base64 string field. Encode the file, copy the result, and the check under it confirms nothing was lost on the way.
Paste a base64 value from a log line, a cookie or one segment of a JWT. Padding and alphabet are worked out for you, and binary content is flagged instead of shown as garbled text.
Switch to File and Decode, paste the data URL, and download it. The file type is recognised from its content, so it opens straight away.
No. It is an encoding with no key, and anyone can reverse it in a second. It exists to carry binary data through systems that only handle text. Use real encryption for anything secret.
Each group of three bytes becomes four characters, so the output is about 133 percent of the input size, plus padding and any line breaks. The figure under the result shows the exact ratio for your data.
Only two characters. URL-safe writes a hyphen instead of plus and an underscore instead of slash, because plus and slash have special meanings in URLs and file names, and it usually drops the trailing equals signs. JWTs use the URL-safe form. When decoding, this tool accepts both without being told.
The bytes are not valid UTF-8, so they cannot be shown as text, and each unreadable byte is displayed as U+FFFD. The tool warns you when this happens. The data is probably binary, such as an image or compressed content; use File mode and Download to get the actual bytes, or switch to Hex to see them.
Base64 is written in groups of four characters, and the last group can be two, three or four characters long but never one. A string whose length is one more than a multiple of four always has a stray or missing character somewhere, often from a copy that cut off the end.
No. Unpadded input is accepted, and the tool tells you how many padding characters it added to decode it.
No. Encoding and decoding happen in your browser, and files are read locally. The share button copies a link with your settings, never the text or file you converted.
Conversions run on your device in JavaScript. The values you enter are never sent over the network.