Online Text Encoding Converter (Base64 / URL / Unicode / HTML Entities / Hex / Binary)

Text ↔ Base64: the text is encoded as UTF-8 first and then turned into Base64; decoding reverses it. URL percent-encoding / decoding: UTF-8 bytes → %XX; encodeURI keeps separators such as / and ?. Unicode escape / unescape: characters → \uXXXX (by Unicode code point, not by UTF-8 bytes). HTML entity encoding / decoding: & < > " → named, decimal or hexadecimal character references. Text ↔ hexadecimal bytes, based on UTF-8 bytes (1 byte = 2 hex digits); "你好" gives E4 BD A0 E5 A5 BD. Text ↔ binary bytes, based on UTF-8 bytes (1 byte = 8 bits); "你" gives 11100100 10111101 10100000.
Example:
Recent conversions
The history is kept in your browser only (localStorage), it is never uploaded and can be removed at any time.
Every conversion runs locally in your browser. Your input is never uploaded to any server and no account is required.

Online Text Encoding Converter (Base64 / URL / Unicode / HTML Entities / Hex / Binary): Encode and Decode Chinese Text and Emoji in One Place

How does the text encoding converter work? Seven encoding types in one page

A text encoding converter converts the same text between Base64, URL, Unicode, HTML entities, Hex, and binary representations.

Paste your content, select the encoding type, and click Encode or Decode to get the result. All processing takes place locally in the browser, and your input is not uploaded to the server.

Why does Base64 make Chinese text longer?

Base64 encodes bytes rather than characters. In UTF-8, a common Chinese character occupies 3 bytes, and 3 bytes become 4 characters after Base64 encoding. Therefore, the Base64 result for Chinese text is usually about one third longer than the original text, and one or two equals signs may appear at the end as padding. This is not an error, but a natural result of representing 3 bytes with 4 characters.

If the result will be placed in a URL, JWT, or filename, use Base64URL. It replaces plus and slash with hyphen and underscore and removes trailing equals signs to avoid secondary escaping during transmission.

Should you use encodeURI or encodeURIComponent for URL encoding?

Use encodeURIComponent when the value will appear as a parameter in a query string. It encodes separators such as slashes, question marks, and ampersands. Use encodeURI when processing spaces and Chinese characters in a complete URL, because it preserves these separators. A typical symptom of choosing the wrong function is passing a complete URL as a parameter and having the server receive only the first query parameter.

What is the difference between Unicode escapes and HTML entities?

Unicode escapes belong to the string representation layer of JavaScript and JSON. They use a backslash followed by u and four hexadecimal digits to represent characters safely in source code. HTML entities belong to the HTML document layer. For example, a less-than sign can be written as &lt; or &#60; so that the browser displays it as text instead of parsing it as a tag. The former addresses source representation and portability, while the latter addresses HTML rendering.

Hex and binary: why is one Chinese character 3 bytes, 6 hexadecimal characters?

This tool outputs UTF-8 bytes. One byte equals 2 hexadecimal characters and 8 binary bits. A common Chinese character occupies 3 bytes in UTF-8, so it is displayed as 6 hexadecimal characters or 24 binary bits. When decoding, Hex input must have an even number of characters and binary input must contain a multiple of 8 bits; otherwise the tool reports an error instead of returning an incorrect result.

Which situations most often cause errors or garbled text?

Three cases are especially common: first, pasting line breaks or spaces together with Base64 content can cause decoding failures or shifted characters; second, choosing the wrong decoding direction, such as trying to decode original text as encoded data; third, treating URL-encoded content as Base64 and trying to decode it. When an error occurs, first verify the encoding type and the encoding or decoding direction.

What can this tool do, and what can it not do?

It can perform bidirectional conversion for seven encoding types, including Chinese and Emoji, multiline text, one-click copying, and recent records stored only in the local browser. It does not perform encryption; Base64 is encoding and can be reversed by anyone. It does not process files or images and does not convert character sets. For Chinese garbled text, use a character encoding converter instead. All processing runs in the browser, and your input is not uploaded to the server.

Where are Base64, URL, Unicode, HTML entities, Hex, and binary used?

These encoding methods solve different problems: Base64 puts binary data into text-only protocols such as email, JWT, and Data URLs; URL encoding makes parameter values safe to transmit in links; Unicode escapes represent arbitrary characters in JSON and JavaScript source code; HTML entities display characters such as angle brackets as text; Hex and binary expose the actual byte-level representation for data inspection.

Putting common encoding methods on one page makes it easier to troubleshoot API parameters, garbled logs, and data formats without switching between multiple sites.

  • All input and results are processed locally in the browser. Nothing is uploaded to the server, and no registration is required.
  • Base64 encodes UTF-8 bytes: one Chinese character uses 3 bytes, so the encoded length is about 1.33 times the original; Chinese text and Emoji can be decoded back correctly.
  • URL encoding supports both encodeURI and encodeURIComponent semantics, with an option to treat plus signs as spaces when decoding.
  • Hex and binary output is based on UTF-8 bytes (1 byte = 2 hexadecimal characters = 8 bits), making byte-level comparison with packet capture tools and database fields easier.
  • Invalid characters, odd-length Hex input, and binary input whose length is not a multiple of 8 are reported as errors instead of producing apparently valid results.
  • This tool performs encoding and decoding only, not encryption: Base64 results can be reversed by anyone.
Text-based encoding conversions can be handled here. For Chinese garbled text or GBK and UTF-8 conversion, use the character encoding converter.
Comments 0
No comments yet. Be the first to comment!
avatar
Comment content cannot be empty
0/255