Base64 & URL Encoder/Decoder
Encode and decode Base64, URL (percent) encoding and HTML entities
Loading the tool…
Encodes text and files as Base64, URL (percent) encoding, HTML entities, Unicode escapes or hex, and decodes them back. Use it to read encoded values in an API response or a URL, or to prepare values for code and configuration.
How to use
- Choose a tab: "Base64", "URL", "HTML entities", "Unicode escapes" or "Hex".
- Type into "Text" to see the "Encoded" result, or paste an encoded value on the right to see the text.
- Set options such as "URL-safe alphabet (- and _)", "Break lines every 76 characters" or "Encode as".
- For files, drop one on "Convert a file to Base64"; save decoded binary data with "Save decoded bytes as a file".
How it works
- Base64 turns every 3 bytes into 4 characters, so the result is about one third longer than the original. Text is converted to UTF-8 bytes first, so accented letters, Korean and emoji are kept intact.
- On the URL tab, encodeURIComponent suits a single query value and encodeURI a whole address. A pasted URL is also split into a table of query parameters.
- Invalid input is reported with the line, column and the problem. Files can be up to 50 MB. Everything is converted in your browser and nothing is sent anywhere.
Questions and answers
- Is Base64 encryption?
- No. Anyone can decode it, so it must not be used to hide passwords or personal data.
- What does %20 mean in a URL?
- It is a percent-encoded space. Form encoding writes a space as + instead, which you can choose with "Space as +".
- How do I turn an image into a Base64 data URI?
- Drop the image on "Convert a file to Base64" and turn on "Output as data URI". The result starts with data:image/png;base64, for a PNG file.
- What is the difference between Base64 and Base64url?
- Base64url uses - and _ instead of + and / and drops the = padding. It is used in JWTs and URLs; turn on "URL-safe alphabet (- and _)" to get it.