メインコンテンツへスキップ

HTMLエンティティ エンコード・デコード

特殊文字をHTMLエンティティにエンコードし、HTMLエンティティをプレーンテキストにデコードします。

Input
0 chars | 0 bytes
Encode
Output
0 chars | 0 bytes

HTML reserves several characters for its own syntax: angle brackets delimit tags, ampersands introduce entities, and quotes delimit attribute values. When user-generated content, code samples, or international text contains any of these characters, they must be converted to HTML entities before insertion into a page — otherwise the browser will interpret them as markup, breaking layout or, worse, enabling cross-site scripting attacks.

This tool is useful for template authors escaping dynamic content, developers writing documentation with inline code examples, and anyone who needs to embed XML or HTML snippets inside an HTML page. You can also run it in reverse to decode entity-heavy strings from email clients, legacy CMS exports, or scraped HTML back into readable text.

HTMLエンティティをオンラインでエンコード・デコードする方法

  1. 1

    テキストまたはHTMLを貼り付ける

    エンコードするプレーンテキスト、またはデコードするHTMLエンティティエンコードされたテキストを貼り付けてください。

  2. 2

    エンコードまたはデコードを選択

    エンコードは<、>、&、"などの文字を安全なHTMLエンティティシーケンスに変換します。デコードはその逆を行います。

  3. 3

    安全な出力をコピー

    結果をコピーしてください。名前付きエンティティ(&amp;)と数値エンティティ(&#38;)の両方がデコード時に認識されます。

How HTML Entity Encoding Works

HTML defines two syntaxes for character references. Named entities use a mnemonic label — `&amp;` for `&`, `&lt;` for `<`, `&gt;` for `>`, `&quot;` for `"`, and `&apos;` for `'`. Numeric character references address Unicode code points directly: `&#60;` and `&#x3C;` both encode `<` using decimal and hexadecimal respectively.

Modern HTML5 parsers are remarkably lenient and will often recover from missing semicolons or unencoded ampersands, but that leniency is not a reason to skip encoding. Security scanners, XML parsers, and email clients are far stricter. The minimal safe set to always encode is `&`, `<`, `>`, `"`, and `'`; everything else is optional but sometimes useful for ensuring ASCII-only output.

FileCrank HTMLエンティティツールを使う理由

  • ✓ <、>、&、"を含むすべてのHTML特殊文字をエンコード。
  • ✓ 名前付きエンティティ(&nbsp;)と数値エンティティ(&#60;)の両方をデコード。
  • ✓ 数値エンティティフォールバックを使用したフルUnicode範囲をカバー。
  • ✓ 完全にブラウザ内で動作 — データはサーバーに送信されません。

機能と仕様

最大ファイルサイズ
最大100 MB
プライバシー
ファイルは約1時間後に削除されます
料金
無料、登録不要
処理方式
100%クライアントサイド
規格
HTML5 named character references
データはブラウザの外に出ません — すべての処理はローカルです。アカウントや登録不要。使用制限なしで無料。

よくある質問

HTMLエンティティをエンコードする必要があるのはなぜですか?

エンコードなしでは<や>のような文字がHTMLタグとして解釈され、ページレイアウトが崩れたりクロスサイトスクリプティング(XSS)攻撃が可能になったりします。HTMLに挿入する前にユーザー提供のコンテンツをエンコードすることは基本的なセキュリティ対策です。

名前付きHTMLエンティティと数値HTMLエンティティの違いは何ですか?

名前付きエンティティは人間が読める名前を使用します:&は&amp;、<は&lt;。数値エンティティは10進数(&#38;)または16進数(&#x26;)のUnicodeコードポイントを使用します。ブラウザでは両方とも同じようにレンダリングされます。

このツールはフルUnicode範囲に対応していますか?

はい。ASCII印刷可能範囲外のすべての文字は数値HTMLエンティティとしてエンコードできます。エンコーダーは標準名が存在する場合は名前付きエンティティを適用し、その他の文字には数値エンコーディングにフォールバックします。

HTMLエンコードとURLエンコードの違いは何ですか?

HTMLエンコードはHTMLマークアップへの安全な挿入のために文字をエスケープします。URLエンコードはURLでの安全な使用のために文字をエスケープします。異なるエスケープシーケンスを使用し、異なるコンテキストに適用されます。

HTML Entities vs. URL Encoding vs. JavaScript String Escaping

Each encoding layer has its own rules and applies to a different context. HTML entities protect markup structure; URL encoding protects URI syntax; JavaScript string escaping protects script literals. Applying HTML entities to a URL or JavaScript string will produce broken output. When building a link with dynamic content inside an HTML attribute, you often need both URL encoding (for the href value) and HTML entity encoding (for the attribute quotes) applied in the correct order.

FileCrank HTMLエンティティエンコード・デコードはHTML特殊文字をエスケープ・アンエスケープします。フルUnicode範囲で名前付きエンティティと数値エンティティをサポートし、完全にブラウザ内で動作します。

Advertisement

Ad