HTML實體編碼與解碼工具
將特殊字元轉換為HTML實體(&、<等),或進行反向轉換。適用於將文字安全地嵌入HTML。
如何使用本工具
- 1
Pick a mode with the Encode or Decode toggle at the top.
- 2
Paste or type your text into the input box.
- 3
Read the converted result in the output panel below, which updates as you type.
- 4
Select and copy the output to use in your HTML or document.
什麼是HTML實體編碼與解碼工具?
HTML實體是用來表示在HTML中具有特殊含義的字元的跳脫序列:&表示&,<表示<,等等。如果你將使用者提供的文字不經編碼就直接嵌入HTML,就會造成XSS漏洞。本工具可將文字轉換為已編碼實體的HTML以便安全嵌入,或將含有實體的HTML解碼還原為純文字。
常見使用場景
Pasting a code snippet into a blog post or docs so tags like <div> display literally instead of rendering.
Escaping user-supplied text before dropping it into an HTML template to avoid breaking the markup.
Decoding entity-laden strings copied from page source, RSS feeds, or scraped HTML back into readable text.
Turning a stray &nbsp; or &mdash; from a CMS export back into a normal space or em dash.
Preparing example strings for tutorials where you need to show the raw entity form of a character.
Quickly checking what ' or — decodes to without writing throwaway code.
常見問題
我應該編碼哪些字元?▼
我應該編碼所有實體,還是只編碼不安全的字元?▼
相關工具
JWT 解碼器
即時解碼 JSON Web Token(JWT)。完全在你的瀏覽器中執行:權杖絕不會離開你的裝置,可安全用於正式環境的密鑰。
JSON格式化與驗證工具
線上格式化、驗證和壓縮JSON。完全在你的瀏覽器中執行:你的資料永遠不會離開你的裝置。
XML 格式化工具
格式化並美化 XML 文件。適用於 SOAP、網站地圖、RSS 訂閱源和設定檔。
Base64 編碼與解碼工具
將字串編碼為 Base64,或將 Base64 解碼為文字。尊重你的隱私:全部在你的瀏覽器中執行。
URL 編碼與解碼工具
將文字轉換為 URL 安全的編碼(百分號編碼),或進行反向轉換。適用於查詢字串、重新導向和 OAuth 流程。
CSS壓縮工具
移除CSS中的註解、空白和不必要的字元,以減小檔案體積。