Hongmu Notes

🧷 URL encoding and decoding

The encoding gives two writing methods at the same time, and the decoding restores the %XX content.

Instructions for use

  • Click "Encode" to get both encodeURI and encodeURIComponent results at the same time
  • Click "Decode" to restore %XX content using decodeURIComponent
  • "Content exchange" backfills the results into the input box, and a prompt will be given for illegal percent signs.

Coding result verification

The results of encodeURI and encodeURIComponent for the same text should only differ in the structural symbols. Checking this can confirm that the encoding is correct.

📌 What’s the difference between the two results?

The difference is only in the structural symbols (such as & = / ? :): encodeURI retains them, encodeURIComponent encodes them into %XX. If the two results are different in Chinese characters or spaces, it means that the input has been modified and needs to be recoded.

🧭 Common uses

It is common to assemble query links with Chinese characters or spaces, safely put user input into parameter values, check the encoded string returned by the backend, and troubleshoot problems such as "& in parameters are treated as delimiters." The two encoding results are given side by side, and the impact of structural symbols can be intuitively seen.

🔒 Dealing with location and privacy

Encoding and decoding are completed locally in the browser. Input and results are not uploaded to the server or written to local storage. They are cleared when the page is refreshed. This is standard character escape and does not provide confidentiality capabilities. Please use specialized encryption tools for sensitive data.

All keywords and tutorials 12

❓ FAQ

Can I save comparison records?
This page does not leave a history. It is recommended that you copy both results for your files.
What does the empty result mean?
The input is empty, or the percent sign is illegal during decoding.
General sequence for coding verification
First confirm that the input is consistent → then check whether the difference is only in structural symbols → finally check the Chinese character encoding.