YourTools.
简体中文
Back to the catalog
Tools

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

Encode and decode text

Run

Processes in this browser; cancel at any time

Add text first

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

  1. Type or paste the text, or select Use example.
  2. Choose a “Codec”, such as “Base64” or “URL (percent-encoding)”, and set “Direction” to “Encode” or “Decode”.
  3. Select Run.
  4. 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 &#39;; all other characters stay as they are. Decoding reads every numeric entity, such as &#20320; or &#x597D;, and common named ones like &amp;, &nbsp;, &copy; and &mdash;; 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.