Monu Tools

HTMLエンティティ変換

テキストをHTMLエンティティにエンコードしたり、エンティティをテキストにデコードしたりします。UTF-8対応でクライアントサイドで処理されます。

HTMLエンコードの使い方

  1. 01

    テキストまたはHTMLを貼り付けてください。

  2. 02

    「エンコード」(HTML特殊文字をエスケープ)、「すべてエンコード」(ASCII以外もエスケープ)、または「デコード」を選択してください。

  3. 03

    変換結果をコピーしてください。

What it does

An HTML entity encoder and decoder for escaping special characters so they display as text instead of being interpreted as markup. It converts characters like < and & into entities such as &lt; and &amp;, and decodes them back again.

Encoding and decoding are UTF-8 safe and run entirely in your browser, so nothing you paste is uploaded.

How encoding works

Encoding always escapes the five characters that have special meaning in HTML: & < > " and '. That is what stops a stray < from being read as the start of a tag, or text from accidentally breaking out of an attribute.

An Encode all option additionally turns every non-ASCII character into a numeric entity, which is useful for legacy systems, some email pipelines, or anywhere you need to be sure the output is pure ASCII.

What decoding understands

Decoding understands all three entity forms: named entities like &amp; and &copy;, decimal entities like &#233;, and hexadecimal entities like &#x20AC;. Sequences it does not recognize are left untouched rather than mangled.

Encoding and XSS

Escaping the HTML specials is the core defense against HTML injection and cross-site scripting (XSS): any untrusted text should be encoded before it is placed into a page, so it renders as harmless characters instead of active markup.

よくある質問

「エンコード」と「すべてエンコード」の違いは何ですか?

「エンコード」はHTMLでエスケープが必要な5文字(& < > " ')のみをエスケープします。「すべてエンコード」はさらにすべてのASCII以外の文字を数値エンティティに変換します。レガシーシステムやメールに便利です。

どのエンティティをデコードできますか?

&amp;や&copy;などの名前付きエンティティ、&#233;などの10進数エンティティ、&#x20AC;などの16進数エンティティをデコードできます。未知のシーケンスはそのまま残ります。

XSSを防止できますか?

HTML特殊文字のエンコードはマークアップのインジェクションに対する核心的な防御手段です。信頼されていないテキストをHTMLに配置する前に常にエンコードしてください。

出典

このツールを埋め込む

このツールをご自身のウェブサイトに追加できます。下のコードをコピーしてください。内容は自動的に最新の状態に保たれます。

<iframe src="https://monu.tools/embed/ja/html-encoder" width="100%" height="640" style="border:1px solid #e5e5e5;border-radius:12px;max-width:680px" loading="lazy" title="Monu Tools"></iframe>

関連ツール