Supports 7 encoding formats · Automatic detection · Batch conversion

Text Encoder & Decoder Text encoding and decoding tools

Multifunctional text encoding and decoding tool. Supports seven formats: Base64, URL Encode, HTML Entity, Unicode Escape, JavaScript Escape, JSON Escape, and XML Escape. Built-in automatic detection and Encoding Inspector.

0 chars

Encoding Inspector

Waiting for analysis⋯

Frequently Asked Questions

What is the difference between Base64 and URL Encode?
Base64 It is a method of encoding binary data into ASCII strings. It is often used to transmit binary content such as images and files in text protocols (such as HTTP and Email). It uses A-Z, a-z, 0-9, +, / and = (padding) for a total of 65 characters.

URL Encode (also known as Percent-encoding) It is used to convert special characters in the URL (such as Chinese, spaces, #, &, etc.) into the %XX format so that they can be safely transmitted in the URL.

The core difference: Base64 encodes binary → text, and URL Encode converts text → URL safe format. The purpose of the two is completely different.
When to use HTML Entity?
HTML Entity is used to display reserved characters (such as <>&) or characters that cannot be entered directly (such as the copyright symbol ©)。

Common usage opportunities:
• Display code snippets in HTML (to avoid being misinterpreted by browsers as HTML tags)
• Display special symbols (©, ®, ™, €, etc.)
• XSS Defense – Escape HTML special characters in user input
• Embed third-party content (e.g. RSS feeds, user comments) in web pages
What is Unicode Escape (\uXXXX)?
Unicode Escape is to convert characters to \\uXXXX Represented in the form of , where XXXX is the hexadecimal value of the Unicode code point (Code Point) of the character.

For example:
A\\u0041
\\u4E16
\\u754C

This representation is common for non-ASCII characters in JSON data, in JavaScript source code where encoding consistency is required, and in some older systems that only support ASCII.
What is JSON Escape used for?
JSON Escape escapes special characters in a string so that it conforms to the JSON format specification. The JSON specification (RFC 7159) requires that the following characters must be escaped:

"\\"(double quotes)
\\\\\\(backslash)
/\\/(slash, optional)
\\b(backspace),\\f(Page change),\\n(line feed),\\r(Enter),\\t(Tabulation)

Improperly escaped JSON results in JSON.parse() failed. This is important when developing APIs, serializing data, and handling user input.
What is the difference between JavaScript Escape and JSON Escape?
Although the two look similar, the specifications they apply to are different:

JSON Escape Follows the JSON specification (RFC 7159). Strictly speaking, only double quotes, backslashes, and control characters (U+0000~U+001F) need to be escaped in the JSON string.

JavaScript Escape then covers a wider range of JavaScript string syntax, including escaping single quotes (in single-quoted strings), and using \\xHH(hex) and \\uHHHH(Unicode) representation.

In practice, if you want to generate JSON data, use JSON Escape; if you want to generate JavaScript code strings, use JavaScript Escape.
What is the judgment logic of Auto Detect?
When you click the "Auto-Detect" button or paste content, the system will try the following judgments in sequence:

1. Base64: Checks for compliance with the Base64 character set (A-Za-z0-9+/=) and a length that is a multiple of 4. Try to decode and confirm whether it is readable text.
2. URL Encode: Checks if the %XX format is included and decoded to valid UTF-8.
3. HTML Entity: Check whether it contains &, <, >, &#XXXX; and other formats.
4. Unicode Escape: Check if it contains \\uXXXX format.
5. JSON Escape: Check whether it contains JSON escape sequences such as \\n, \\t, \\", etc.

If multiple formats are matched, the system will prioritize the most credible result. If no match is found, it is treated as normal text.

The world of text encoding: from ASCII to Unicode

In computer science, "text encoding" is the process of converting characters into a binary format that a computer can process. From the earliest ASCII (only 128 characters) to the current Unicode (covering more than 140,000 characters), the evolution of text encoding reflects the growing demand for global information exchange.

Why do we need so many encoding methods?

Different encoding methods serve different scenarios. Base64 solves the problem of "transmitting binary data in text protocols"; URL Encode solves the problem of "safe transmission of special characters in the URL"; HTML Entity solves the problem of "reserved characters are displayed correctly in HTML"; Unicode Escape solves the problem of "non-ASCII characters are represented in a pure ASCII environment".

Each encoding method has its own unique applicable scenarios, which is why developers need to be familiar with multiple encoding formats.

The practical value of automatic detection

In actual development, we often encounter data whose encoding format cannot be confirmed - it may be responses from third-party APIs, fields exported from the database, or messages sent by other systems. At this time, the automatic detection function can help you quickly identify the encoding method of the data, saving you the time of manually trying different decoding methods.

However, it is important to note that automatic detection is not 100% accurate. Certain encoding formats (such as Base64 vs. regular text) may be difficult to distinguish in some situations. If the detection result is incorrect, it is recommended to manually switch to the corresponding format for encoding and decoding.

Security considerations

Proper encoding/escaping is an important part of preventing security vulnerabilities when handling user input or third-party data. For example:

XSS defense: When displaying user input in a web page, HTML Entity Escape should be used to avoid malicious script injection.

JSON injection: When constructing JSON data, ensure that string values undergo JSON Escape to avoid damaging the JSON structure.

Command Injection: When splicing system commands, make sure special characters are escaped correctly or use parameterized queries.

All operations of this tool are completed on the browser side, and your data will not be sent to any server to ensure data security.

Text Encoder & Decoder Text Encoding and Decoder Tool Instructions

Free online text encoding and decoding tool. Supports seven formats: Base64, URL Encode, HTML Entity, Unicode Escape, JavaScript/JSON/XML Escape. Automatic detection of encoding types, batch conversion, and built-in Encoding Inspector analysis.

Recommended operating procedures

  1. Confirm the input format, units and necessary fields first to avoid incorrect data being transmitted all the way to the results.
  2. Adjust tool options and read instant tips to cross-check with representative boundary values.
  3. Double-check the results before copying or downloading; for use in formal processes, complete validation in the target environment.

Quality and privacy

This tool executes natively in the browser and does not rely on backend processing. The results will be affected by input quality, browser support and related technical specifications. Please keep the original version and backup of important data.

Operation successful