Encode and decode text
Encode or decode Base64, Base64URL, URL, hexadecimal or HTML entities. Encoding is not encryption.
Process locally
Files stay in this browser session. Closing or clearing releases them.
Add text
Type or paste the text to process
Adjust settings
Optional: Codec, Direction
Run
Processes in this browser; cancel at any time
About this tool
Encode or decode text as Base64, Base64URL, URL percent-encoding, hexadecimal or HTML entities. Use it to read a Base64 string from a log or an API response, to encode a Chinese search term before putting it in a query string, or to turn < and & into entities before you paste text into HTML.
Text is handled as UTF-8, and decoded results must be UTF-8 text. Encoding is not encryption: anyone can decode the result. Up to 1 MB of text is processed in your browser without being uploaded.
How to use it
- Type or paste the text, or select Use example.
- Choose a “Codec”, such as “Base64” or “URL (percent-encoding)”, and set “Direction” to “Encode” or “Decode”.
- Select Run.
- Preview the result and download it as a text file.
Formats and limits
- Input
- Text
- Output
- Plain text
- Size limit
- 1 MB
- Settings
- Codec (Base64, Base64URL, URL, Hexadecimal, HTML entities); Direction (Encode, Decode)
- Privacy
- Files stay in the current browser session. No file bytes are uploaded.
- Price
- Free, no sign-up
Common questions
What is the difference between Base64 and Base64URL?
Base64URL uses - and _ instead of + and / and leaves out the = padding, so the result can go into a URL or a file name; JWTs use it. Decoding Base64URL works with or without padding, while the “Base64” option rejects - and _.
Why does decoding some Base64 fail?
This tool returns text, so decoding stops when the bytes are not valid UTF-8, as with the Base64 of an image or a compressed file. Use the “Base64 to image or file” tool to turn such data back into a file.
Why does URL encoding also encode : and /?
“URL (percent-encoding)” encodes one component, such as a single query parameter value, so characters like :, /, ?, & and = are encoded too and spaces become %20. Encode only the part you need, not a whole address. When decoding, a + stays a + and is not turned into a space.
Which HTML entities are supported?
Encoding converts only &, <, >, " and ', the last one to '; all other characters stay as they are. Decoding reads every numeric entity, such as 你 or 好, and common named ones like &, , © and —; other named entities are left unchanged.
Can I decode hex that has spaces or 0x in it?
Spaces and line breaks between the byte pairs are fine, but prefixes such as 0x are not, so remove them first. Encoding writes each UTF-8 byte as two lowercase hex digits without separators.
Related tools
Unicode, HTML, URL and Punycode escapes
Convert text to and from \u escapes, HTML numeric entities, percent-encoding in any character set (such as GBK URLs), Quoted-Printable and Punycode domains.
Base16/32/58/64/85/91 encoding
Encode or decode Base16, Base32, Base58, Base62, Base64, Ascii85, Z85 and basE91, choosing the character set of the text, or hex for raw bytes.
Character set encoding and mojibake repair
Show the bytes of text in UTF-8, GBK, GB18030, Big5, Shift_JIS and more as hex, turn hex back into text, or repair mojibake from text read in the wrong character set.
Base64 to image or file
Turn Base64 or a data: URI back into a file such as an image; the type comes from the content or the URI.
Image or file to Base64
Encode images or any other file as Base64 or as a data: URI to paste into HTML, CSS or JSON.
Byte radix and endianness converter
Convert bytes between hex, binary, octal, unsigned or signed decimal, Base64 and UTF-8 text, and swap byte order between big and little endian in 2, 4 or 8-byte words.